From e91436642a545bf5edb6e186f8d9a7a379d97771 Mon Sep 17 00:00:00 2001 From: Volker Date: Sat, 6 Feb 2016 19:59:48 -0500 Subject: [PATCH] Make Author example and test vet compliant Using the example from the documentation will result in a warning for unkeyed composite literals during a 'go vet' run --- README.md | 4 ++-- doc.go | 4 ++-- feed_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 27658e5..e499be8 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ func main() { Title: "jmoiron.net blog", Link: &feeds.Link{Href: "http://jmoiron.net/blog"}, Description: "discussion about tech, footie, photos", - Author: &feeds.Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &feeds.Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, } @@ -37,7 +37,7 @@ func main() { Title: "Limiting Concurrency in Go", Link: &feeds.Link{Href: "http://jmoiron.net/blog/limiting-concurrency-in-go/"}, Description: "A discussion on controlled parallelism in golang", - Author: &feeds.Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &feeds.Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, }, &feeds.Item{ diff --git a/doc.go b/doc.go index 4a870eb..5b005ea 100644 --- a/doc.go +++ b/doc.go @@ -22,7 +22,7 @@ Create a Feed and some Items in that feed using the generic interfaces: Title: "jmoiron.net blog", Link: &Link{Href: "http://jmoiron.net/blog"}, Description: "discussion about tech, footie, photos", - Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, Copyright: "This work is copyright © Benjamin Button", } @@ -32,7 +32,7 @@ Create a Feed and some Items in that feed using the generic interfaces: Title: "Limiting Concurrency in Go", Link: &Link{Href: "http://jmoiron.net/blog/limiting-concurrency-in-go/"}, Description: "A discussion on controlled parallelism in golang", - Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, }, &Item{ diff --git a/feed_test.go b/feed_test.go index ac5a4cb..c3e31e7 100644 --- a/feed_test.go +++ b/feed_test.go @@ -113,7 +113,7 @@ func TestFeed(t *testing.T) { Title: "jmoiron.net blog", Link: &Link{Href: "http://jmoiron.net/blog"}, Description: "discussion about tech, footie, photos", - Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, Copyright: "This work is copyright © Benjamin Button", } @@ -123,7 +123,7 @@ func TestFeed(t *testing.T) { Title: "Limiting Concurrency in Go", Link: &Link{Href: "http://jmoiron.net/blog/limiting-concurrency-in-go/"}, Description: "A discussion on controlled parallelism in golang", - Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"}, + Author: &Author{Name: "Jason Moiron", Email: "jmoiron@jmoiron.net"}, Created: now, }, {