Add gofmt, goimports, vet, and codecov
diff --git a/.travis.yml b/.travis.yml
index a419034..a0443a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,3 +3,13 @@
go:
- 1.5
- 1.6
+before_install:
+ - go get golang.org/x/tools/cmd/cover
+ - go get golang.org/x/tools/cmd/goimports
+script:
+ - gofmt -l .
+ - goimports -l .
+ - go tool vet .
+ - go test -coverprofile=coverage.txt -covermode=atomic
+after_success:
+ - bash <(curl -s https://codecov.io/bash)
diff --git a/README.md b/README.md
index 9b6e556..8cb1b9c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,9 @@
-GAX: Google API eXtension
-=========================
+Google API Extensions for Go
+============================
-GAX provides the utilities for gRPC-based API client libraries.
+[![Build Status](https://travis-ci.org/googleapis/gax-golang.svg?branch=master)](https://travis-ci.org/googleapis/gax-golang)
+[![Code Coverage](https://img.shields.io/codecov/c/github/googleapis/gax-golang.svg)](https://codecov.io/github/googleapis/gax-golang)
+
+Google API Extensions for Go (gax-golang) is a set of modules which aids the
+development of APIs for clients and servers based on `gRPC` and Google API
+conventions.
diff --git a/api_callable.go b/api_callable.go
index f7544b0..10b79a5 100644
--- a/api_callable.go
+++ b/api_callable.go
@@ -47,7 +47,6 @@
delay = scaleDuration(delay, backoffSettings.delayTimeoutSettings.multiplier)
timeout = scaleDuration(timeout, backoffSettings.rpcTimeoutSettings.multiplier)
}
- return nil
}
// invokeWithTimeout calls stub with a timeout applied to its context.
diff --git a/api_callable_test.go b/api_callable_test.go
index 3462818..de05681 100644
--- a/api_callable_test.go
+++ b/api_callable_test.go
@@ -61,7 +61,9 @@
}
count += 1
<-childCtx.Done()
- return grpc.Errorf(codes.DeadlineExceeded, "")
+ // Workaround for `go vet`: https://github.com/grpc/grpc-go/issues/90
+ errf := grpc.Errorf
+ return errf(codes.DeadlineExceeded, "")
}, testCallSettings...)
if count != 3 || err == nil {
t.Errorf("expected call to retry 3 times and return an error")
@@ -80,7 +82,8 @@
return nil
}
<-childCtx.Done()
- return grpc.Errorf(codes.DeadlineExceeded, "")
+ errf := grpc.Errorf
+ return errf(codes.DeadlineExceeded, "")
}, testCallSettings...)
if count != 3 || resp != 42 || err != nil {
t.Errorf("expected call to retry 3 times, return nil, and set resp to 42")