Skip to content

Commit

Permalink
Avoid milisec
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Gutierrez committed Jul 11, 2023
1 parent 507b86f commit 7dc97f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dockerhub/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (t *Time) UnmarshalJSON(data []byte) error {
if len(data) <= 4 {
return nil
}
vt, err := time.Parse("2006-01-02T15:04:05.00", string(data)[1:23])
vt, err := time.Parse("2006-01-02T15:04:05", string(data)[1:20])
if err == nil {
*t = Time(vt)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/dockerhub/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestTime_UnmarshalJSON(t *testing.T) {
}{
{"Null", "null", Time{}},
{"Empty", "", Time{}},
{"Parsing", "\"2019-06-08T17:34:35.543678\"", Time(time.Date(2019, time.June, 8, 17, 34, 35, 540000000, time.UTC))},
{"Parsing", "\"2019-06-08T17:34:35.543678\"", Time(time.Date(2019, time.June, 8, 17, 34, 35, 000000000, time.UTC))},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 7dc97f2

Please sign in to comment.