Skip to content

Commit

Permalink
travis: Only check gofmt on Go 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed May 31, 2019
1 parent a924560 commit c01685b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
GOVERSION := $(shell go version | cut -d ' ' -f 3 | cut -d '.' -f 2)

.PHONY: check fmt lint test test-race vet test-cover-html help
.DEFAULT_GOAL := help
Expand All @@ -12,11 +12,13 @@ test-race: ## Run tests with race detector
go test -race ./...

fmt: ## Run gofmt linter
ifeq "$(GOVERSION)" "12"
@for d in `go list` ; do \
if [ "`gofmt -l -s $$GOPATH/src/$$d | tee /dev/stderr`" ]; then \
echo "^ improperly formatted go files" && echo && exit 1; \
fi \
done
endif

lint: ## Run golint linter
@for d in `go list` ; do \
Expand Down

0 comments on commit c01685b

Please sign in to comment.