Makefile 715 B

123456789101112131415161718192021222324252627
  1. default: fmt get update test lint
  2. GO := GO111MODULE=on GOPRIVATE=github.com/linkedin GOSUMDB=off go
  3. GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
  4. GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race -timeout 6m -coverprofile=profile.out -covermode=atomic
  5. FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
  6. TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go')
  7. get:
  8. $(GO) get ./...
  9. $(GO) mod verify
  10. $(GO) mod tidy
  11. update:
  12. $(GO) get -u -v all
  13. $(GO) mod verify
  14. $(GO) mod tidy
  15. fmt:
  16. gofmt -s -l -w $(FILES) $(TESTS)
  17. lint:
  18. golangci-lint run
  19. test:
  20. $(GOTEST) ./...