blob: c3b431a562d95905bb96dbde8e1281ee7a2e4814 [file] [log] [blame]
Scott Baker105df152020-04-13 15:55:14 -07001default: fmt get update test lint
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00002
Scott Baker105df152020-04-13 15:55:14 -07003GO := GO111MODULE=on GOPRIVATE=github.com/linkedin GOSUMDB=off go
4GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
5GOTEST := $(GO) test -gcflags='-l' -p 3 -v -race -timeout 6m -coverprofile=profile.out -covermode=atomic
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00006
Scott Baker105df152020-04-13 15:55:14 -07007FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
8TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go')
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +00009
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +000010get:
Scott Baker105df152020-04-13 15:55:14 -070011 $(GO) get ./...
12 $(GO) mod verify
13 $(GO) mod tidy
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +000014
Scott Baker105df152020-04-13 15:55:14 -070015update:
16 $(GO) get -u -v all
17 $(GO) mod verify
18 $(GO) mod tidy
Dinesh Belwalkare63f7f92019-11-22 23:11:16 +000019
Scott Baker105df152020-04-13 15:55:14 -070020fmt:
21 gofmt -s -l -w $(FILES) $(TESTS)
22
23lint:
24 golangci-lint run
25
26test:
27 $(GOTEST) ./...