Fix composite literal uses unkeyed fields
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ const (
|
||||
|
||||
// XMLTime - time wrapper
|
||||
type XMLTime struct {
|
||||
time.Time
|
||||
Time time.Time
|
||||
}
|
||||
|
||||
// UnmarshalXML - unmarshal incoming xml
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user