Skip to content

Commit

Permalink
Merge pull request #90 from oliver006/oh_test_gofmt
Browse files Browse the repository at this point in the history
Fail tests if code isn't gofmt'd
  • Loading branch information
oliver006 authored Aug 7, 2017
2 parents c0dc4bf + fb487c9 commit 7851752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ machine:
SRC_LOCATION: "/home/ubuntu/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
COVERAGE_PROFILE: "/home/ubuntu/coverage.out"
GO_LDFLAGS: '-extldflags "-static" -X main.VERSION=$CIRCLE_TAG -X main.COMMIT_SHA1=$CIRCLE_SHA1 -X main.BUILD_DATE=$(date +%F-%T)'
MY_GO_VERSION: "1.8.1"
MY_GO_VERSION: "1.8.3"

dependencies:
pre:
Expand Down Expand Up @@ -39,6 +39,8 @@ test:
pre:
- wget https://storage.googleapis.com/golang/go$MY_GO_VERSION.linux-amd64.tar.gz && sudo rm -rf /usr/local/go/ && sudo tar -C /usr/local -xzf go$MY_GO_VERSION.linux-amd64.tar.gz
- go version
- echo " ! gofmt -d main.go 2>&1 | read " | bash
- echo " ! gofmt -d exporter/*.go 2>&1 | read " | bash
- go vet ./...
- go get github.com/mattn/goveralls
- go get golang.org/x/tools/cmd/cover
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (

func main() {
flag.Parse()

switch *logFormat {
case "json":
log.SetFormatter(&log.JSONFormatter{})
Expand Down

0 comments on commit 7851752

Please sign in to comment.