From 7bcadec3657247cab1c9f9993eb75c5a3b718cff Mon Sep 17 00:00:00 2001 From: Matt Silverlock Date: Sun, 22 Nov 2015 16:28:37 +0800 Subject: [PATCH 1/2] [ci] Run go vet, gofmt and the race detector during tests. --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f983b60..83ab8f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,14 @@ language: go sudo: false - go: - 1.3 - 1.4 - 1.5 - tip +install: + - go get golang.org/x/tools/cmd/vet +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d -s .) + - go tool vet . + - go test -v -race ./... From ed5ab67a18408fae2e9caac7f7c99296e6a94678 Mon Sep 17 00:00:00 2001 From: Matt Silverlock Date: Sun, 22 Nov 2015 16:59:23 +0800 Subject: [PATCH 2/2] [fmt] gofmt'ed structs in test. --- feed_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/feed_test.go b/feed_test.go index f5f592d..6fa5b5e 100644 --- a/feed_test.go +++ b/feed_test.go @@ -119,38 +119,37 @@ func TestFeed(t *testing.T) { } feed.Items = []*Item{ - &Item{ + { 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"}, Created: now, }, - &Item{ + { Title: "Logic-less Template Redux", Link: &Link{Href: "http://jmoiron.net/blog/logicless-template-redux/"}, Description: "More thoughts on logicless templates", Created: now, }, - &Item{ + { Title: "Idiomatic Code Reuse in Go", Link: &Link{Href: "http://jmoiron.net/blog/idiomatic-code-reuse-in-go/"}, Description: "How to use interfaces effectively", Created: now, }, - &Item{ + { Title: "Never Gonna Give You Up Mp3", Link: &Link{Href: "http://example.com/RickRoll.mp3", Length: "123456", Type: "audio/mpeg"}, Description: "Never gonna give you up - Never gonna let you down.", Created: now, }, - &Item{ + { Title: "String formatting in Go", Link: &Link{Href: "http://example.com/strings"}, Description: "How to use things like %s, %v, %d, etc.", Created: now, - }, - } + }} atom, err := feed.ToAtom() if err != nil {