Makefile 798 B

123456789101112131415161718192021222324252627282930313233343536
  1. all: test
  2. deps:
  3. # dependencies
  4. go get github.com/pborman/uuid
  5. go get github.com/shirou/gopsutil/load
  6. go get golang.org/x/sys/unix
  7. # testing libs
  8. go get github.com/stretchr/testify/mock
  9. go get github.com/stretchr/testify/assert
  10. prepare: deps
  11. # needed for `make fmt`
  12. go get golang.org/x/tools/cmd/goimports
  13. # linters
  14. go get github.com/alecthomas/gometalinter
  15. gometalinter --install
  16. # needed for `make cover`
  17. go get golang.org/x/tools/cmd/cover
  18. @echo Now you should be ready to run "make"
  19. test:
  20. @go test -parallel 4 ./...
  21. # goimports produces slightly different formatted code from go fmt
  22. fmt:
  23. find . -name "*.go" -exec goimports -w {} \;
  24. lint:
  25. gometalinter
  26. cover:
  27. go test -cover -coverprofile cover.out
  28. go tool cover -html=cover.out
  29. .PHONY: all prepare test fmt lint cover