1 .PHONY: default clean check test fmt 2 3 GOFILES := $(shell go list -f '{{range $$index, $$element := .GoFiles}}{{$$.Dir}}/{{$$element}}{{"\n"}}{{end}}' ./... | grep -v '/vendor/') 4 5 default: clean check test build 6 7 test: clean 8 go test -v -cover ./... 9 10 clean: 11 rm -f cover.out 12 13 build: 14 go build 15 16 fmt: 17 gofmt -s -l -w $(GOFILES) 18 19 check: 20 golangci-lint run 21