From 03248884deffdca26070657237ab87f1844fcff3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 22 Mar 2015 20:14:53 -0700 Subject: [PATCH] Fix composite literal uses unkeyed fields --- cmd-ls.go | 2 +- pkg/client/xmltime.go | 2 +- pkg/s3/client_test.go | 11 ++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cmd-ls.go b/cmd-ls.go index 69e90d11..577ce8b8 100644 --- a/cmd-ls.go +++ b/cmd-ls.go @@ -34,7 +34,7 @@ const ( // printBuckets lists buckets and its meta-dat func printBuckets(v []*client.Bucket) { for _, b := range v { - msg := fmt.Sprintf("%23s %13s %s", b.CreationDate.Local().Format(printDate), "", b.Name) + msg := fmt.Sprintf("%23s %13s %s", b.CreationDate.Time.Local().Format(printDate), "", b.Name) info(msg) } } diff --git a/pkg/client/xmltime.go b/pkg/client/xmltime.go index 9484a568..794311ed 100644 --- a/pkg/client/xmltime.go +++ b/pkg/client/xmltime.go @@ -29,7 +29,7 @@ const ( // XMLTime - time wrapper type XMLTime struct { - time.Time + Time time.Time } // UnmarshalXML - unmarshal incoming xml diff --git a/pkg/s3/client_test.go b/pkg/s3/client_test.go index b2420b2b..40ef595b 100644 --- a/pkg/s3/client_test.go +++ b/pkg/s3/client_test.go @@ -64,14 +64,11 @@ func TestParseBuckets(t *testing.T) { t.Errorf("num parsed buckets = %d; want %d", g, w) } - t1, err := time.Parse(iso8601Format, "2006-06-21T07:04:31.000Z") - t2, err := time.Parse(iso8601Format, "2006-06-21T07:04:32.000Z") - xmlT1 := client.XMLTime{t1} - xmlT2 := client.XMLTime{t2} - + t1, _ := time.Parse(iso8601Format, "2006-06-21T07:04:31.000Z") + t2, _ := time.Parse(iso8601Format, "2006-06-21T07:04:32.000Z") want := []*client.Bucket{ - {Name: "bucketOne", CreationDate: xmlT1}, - {Name: "bucketTwo", CreationDate: xmlT2}, + {Name: "bucketOne", CreationDate: client.XMLTime{Time: t1}}, + {Name: "bucketTwo", CreationDate: client.XMLTime{Time: t2}}, } dump := func(v []*client.Bucket) { for i, b := range v {