Skip to content

Commit

Permalink
all, travis: build against 1.6, require no messages from gofmt, govet
Browse files Browse the repository at this point in the history
Also disables tip because gimme is broken. See travis-ci/gimme#38.

Change-Id: I1a757c6e15827a6861d949c3896e35bf7d62d878
  • Loading branch information
Cori1109 committed Feb 18, 2016
1 parent 6cc17e5 commit 5370ce5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@ language: go

go:
- 1.5.3
- tip
- 1.6
# - tip # NOTE: disabled - see https://github.com/travis-ci/gimme/issues/38

install:
- go get golang.org/x/tools/cmd/vet
- go get github.com/golang/lint/golint

script:
- go test -v ./...
- go vet ./...
- GOFMT=$(gofmt -d -s .) && echo $GOFMT && test -z "$GOFMT"
4 changes: 2 additions & 2 deletions docs/appengine/mail/mailgun/mailgun.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func SendSimpleMessageHandler(w http.ResponseWriter, r *http.Request) {
/* To */ "[email protected]", "YOU@YOUR_DOMAIN_NAME",
))
if err != nil {
msg := fmt.Sprintf("Could not send message: %v, ID %d, %+v", err, id, msg)
msg := fmt.Sprintf("Could not send message: %v, ID %v, %+v", err, id, msg)
http.Error(w, msg, http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -61,7 +61,7 @@ func SendComplexMessageHandler(w http.ResponseWriter, r *http.Request) {

msg, id, err := mg.Send(message)
if err != nil {
msg := fmt.Sprintf("Could not send message: %v, ID %d, %+v", err, id, msg)
msg := fmt.Sprintf("Could not send message: %v, ID %v, %+v", err, id, msg)
http.Error(w, msg, http.StatusInternalServerError)
return
}
Expand Down
4 changes: 2 additions & 2 deletions docs/managed_vms/analytics/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ func handle(w http.ResponseWriter, r *http.Request) {

func trackEvent(r *http.Request, category, action, label string, value *uint) error {
if gaPropertyID == "" {
return errors.New("analytics: GA_TRACKING_ID environment variable.")
return errors.New("analytics: GA_TRACKING_ID environment variable is missing")
}
if category == "" || action == "" {
return errors.New("analytics: category and action are required.")
return errors.New("analytics: category and action are required")
}

v := url.Values{
Expand Down
4 changes: 2 additions & 2 deletions docs/managed_vms/mailgun/mailgun.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func sendSimpleMessageHandler(w http.ResponseWriter, r *http.Request) {
/* To */ "[email protected]", "YOU@"+mailgunDomain,
))
if err != nil {
msg := fmt.Sprintf("Could not send message: %v, ID %d, %+v", err, id, msg)
msg := fmt.Sprintf("Could not send message: %v, ID %v, %+v", err, id, msg)
http.Error(w, msg, http.StatusInternalServerError)
return
}
Expand All @@ -79,7 +79,7 @@ func sendComplexMessageHandler(w http.ResponseWriter, r *http.Request) {

msg, id, err := mailgunClient.Send(message)
if err != nil {
msg := fmt.Sprintf("Could not send message: %v, ID %d, %+v", err, id, msg)
msg := fmt.Sprintf("Could not send message: %v, ID %v, %+v", err, id, msg)
http.Error(w, msg, http.StatusInternalServerError)
return
}
Expand Down
4 changes: 2 additions & 2 deletions getting-started/bookshelf/db_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (db *memoryDB) DeleteBook(id int64) error {
defer db.mu.Unlock()

if _, ok := db.books[id]; !ok {
return fmt.Errorf("memorydb: could not delete book with ID %d, does not exist.", id)
return fmt.Errorf("memorydb: could not delete book with ID %d, does not exist", id)
}
delete(db.books, id)
return nil
Expand Down Expand Up @@ -103,7 +103,7 @@ func (db *memoryDB) ListBooks() ([]*Book, error) {
db.mu.Lock()
defer db.mu.Unlock()

books := make([]*Book, 0)
var books []*Book
for _, b := range db.books {
books = append(books, b)
}
Expand Down
4 changes: 2 additions & 2 deletions getting-started/bookshelf/db_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (db *mysqlDB) ListBooks() ([]*Book, error) {
}
defer rows.Close()

books := make([]*Book, 0)
var books []*Book
for rows.Next() {
book, err := scanBook(rows)
if err != nil {
Expand Down Expand Up @@ -193,7 +193,7 @@ func (db *mysqlDB) ListBooksCreatedBy(userID string) ([]*Book, error) {
}
defer rows.Close()

books := make([]*Book, 0)
var books []*Book
for rows.Next() {
book, err := scanBook(rows)
if err != nil {
Expand Down

0 comments on commit 5370ce5

Please sign in to comment.