Build script and README update for Go fmt & vet checks as well as include badges to README (#29)
* Travis build script updated to check for go fmt & vet; Included coverage mode as atomic
* Travis build status, Go Doc and Go Report badges added to README.md
diff --git a/.travis.yml b/.travis.yml
index 9a1d122..e7c5687 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,4 +12,6 @@
- glide up --strip-vendor
script:
- - go test $(glide novendor)
+ - diff -u <(echo -n) <(gofmt -d $(git ls-files | grep '.go$' | grep -v vendor))
+ - go vet $(glide novendor)
+ - go test -covermode=atomic $(glide novendor)
diff --git a/README.md b/README.md
index e9cdb6b..17a3213 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# ApidAnalytics
+[](https://travis-ci.org/apid/apidAnalytics) [](https://godoc.org/github.com/apid/apidAnalytics) [](https://goreportcard.com/report/github.com/apid/apidAnalytics)
+
This is a core plugin for [apid](http://github.com/apid/apid) and is responsible for collecting analytics data for
runtime traffic from Micro and Enterprise Gateway and puplishing to Apigee.
diff --git a/api_test.go b/api_test.go
index a9a78c1..08ed8ce 100644
--- a/api_test.go
+++ b/api_test.go
@@ -333,8 +333,8 @@
func makeRequest(req *http.Request) (*http.Response, errResponse) {
res, err := client.Do(req)
- defer res.Body.Close()
Expect(err).ShouldNot(HaveOccurred())
+ defer res.Body.Close()
var body errResponse
respBody, _ := ioutil.ReadAll(res.Body)
diff --git a/upload_manager.go b/upload_manager.go
index 7c15259..0b12362 100644
--- a/upload_manager.go
+++ b/upload_manager.go
@@ -69,7 +69,7 @@
if uploadedDirCnt > 0 {
// After a successful upload, retry the
// folders in failed directory as they might have
- // failed due to intermitent S3/GCS issue
+ // failed due to intermittent S3/GCS issue
retryFailedUploads()
}
}