Pragya Arya | 324337e | 2020-02-20 14:35:08 +0530 | [diff] [blame] | 1 | default: fmt get update test lint |
| 2 | |
| 3 | GO := GO111MODULE=on GOPRIVATE=github.com/linkedin GOSUMDB=off 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 |
| 6 | |
| 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') |
| 9 | |
| 10 | get: |
| 11 | $(GO) get ./... |
| 12 | $(GO) mod verify |
| 13 | $(GO) mod tidy |
| 14 | |
| 15 | update: |
| 16 | $(GO) get -u -v all |
| 17 | $(GO) mod verify |
| 18 | $(GO) mod tidy |
| 19 | |
| 20 | fmt: |
| 21 | gofmt -s -l -w $(FILES) $(TESTS) |
| 22 | |
| 23 | lint: |
| 24 | golangci-lint run |
| 25 | |
| 26 | test: |
| 27 | $(GOTEST) ./... |