khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 1 | default: fmt get update test lint |
William Kurkian | daa6bb2 | 2019-03-07 12:26:28 -0500 | [diff] [blame] | 2 | |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 3 | GO := go |
| 4 | GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) |
| 5 | GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race -timeout 6m -coverprofile=profile.out -covermode=atomic |
khenaidoo | ac63710 | 2019-01-14 15:44:34 -0500 | [diff] [blame] | 6 | |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 7 | FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go') |
| 8 | TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go') |
khenaidoo | ac63710 | 2019-01-14 15:44:34 -0500 | [diff] [blame] | 9 | |
khenaidoo | ac63710 | 2019-01-14 15:44:34 -0500 | [diff] [blame] | 10 | get: |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 11 | $(GO) get ./... |
| 12 | $(GO) mod verify |
| 13 | $(GO) mod tidy |
Scott Baker | 8461e15 | 2019-10-01 14:44:30 -0700 | [diff] [blame] | 14 | |
khenaidoo | d948f77 | 2021-08-11 17:49:24 -0400 | [diff] [blame] | 15 | update: |
| 16 | $(GO) get -u -v ./... |
| 17 | $(GO) mod verify |
| 18 | $(GO) mod tidy |
| 19 | |
| 20 | fmt: |
| 21 | gofmt -s -l -w $(FILES) $(TESTS) |
| 22 | |
| 23 | lint: |
| 24 | GOFLAGS="-tags=functional" golangci-lint run |
| 25 | |
| 26 | test: |
| 27 | $(GOTEST) ./... |
| 28 | |
| 29 | .PHONY: test_functional |
| 30 | test_functional: |
| 31 | $(GOTEST) -tags=functional ./... |