Makefile 764 B

12345678910111213141516171819202122232425262728293031
  1. default: fmt get update test lint
  2. GO := go
  3. GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
  4. GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race -timeout 10m -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 ./...
  13. $(GO) mod verify
  14. $(GO) mod tidy
  15. fmt:
  16. gofmt -s -l -w $(FILES) $(TESTS)
  17. lint:
  18. GOFLAGS="-tags=functional" golangci-lint run
  19. test:
  20. $(GOTEST) ./...
  21. .PHONY: test_functional
  22. test_functional:
  23. $(GOTEST) -tags=functional ./...