Skip to content

Commit 7dc97f2

Browse files
author
Julio Gutierrez
committed
Avoid milisec
1 parent 507b86f commit 7dc97f2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/dockerhub/tags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (t *Time) UnmarshalJSON(data []byte) error {
2323
if len(data) <= 4 {
2424
return nil
2525
}
26-
vt, err := time.Parse("2006-01-02T15:04:05.00", string(data)[1:23])
26+
vt, err := time.Parse("2006-01-02T15:04:05", string(data)[1:20])
2727
if err == nil {
2828
*t = Time(vt)
2929
}

lib/dockerhub/tags_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestTime_UnmarshalJSON(t *testing.T) {
8383
}{
8484
{"Null", "null", Time{}},
8585
{"Empty", "", Time{}},
86-
{"Parsing", "\"2019-06-08T17:34:35.543678\"", Time(time.Date(2019, time.June, 8, 17, 34, 35, 540000000, time.UTC))},
86+
{"Parsing", "\"2019-06-08T17:34:35.543678\"", Time(time.Date(2019, time.June, 8, 17, 34, 35, 000000000, time.UTC))},
8787
}
8888
for _, tt := range tests {
8989
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)