Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Many Go tools take file globs or directories as arguments instead of packages.
  2. PACKAGE_FILES ?= *.go
  3. # For pre go1.6
  4. export GO15VENDOREXPERIMENT=1
  5. .PHONY: build
  6. build:
  7. go build -i ./...
  8. .PHONY: install
  9. install:
  10. glide --version || go get github.com/Masterminds/glide
  11. glide install
  12. .PHONY: test
  13. test:
  14. go test -cover -race ./...
  15. .PHONY: install_ci
  16. install_ci: install
  17. go get github.com/wadey/gocovmerge
  18. go get github.com/mattn/goveralls
  19. go get golang.org/x/tools/cmd/cover
  20. .PHONY: install_lint
  21. install_lint:
  22. go get golang.org/x/lint/golint
  23. .PHONY: lint
  24. lint:
  25. @rm -rf lint.log
  26. @echo "Checking formatting..."
  27. @gofmt -d -s $(PACKAGE_FILES) 2>&1 | tee lint.log
  28. @echo "Checking vet..."
  29. @go vet ./... 2>&1 | tee -a lint.log;)
  30. @echo "Checking lint..."
  31. @golint $$(go list ./...) 2>&1 | tee -a lint.log
  32. @echo "Checking for unresolved FIXMEs..."
  33. @git grep -i fixme | grep -v -e vendor -e Makefile | tee -a lint.log
  34. @[ ! -s lint.log ]
  35. .PHONY: test_ci
  36. test_ci: install_ci build
  37. ./scripts/cover.sh $(shell go list $(PACKAGES))