Debian Codegraph @

Makefile

raw
1 SHELL := /bin/sh
2
3 SRC := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
4 PKGS := $(shell go list ./... | grep -v /vendor/)
5
6 .PHONY: all build clean fmt lint reflex simplify test
7
8 all: clean test lint build
9
10 clean:
11 go clean $(PKGS)
12
13 deps:
14 go get ./...
15
16 build:
17 go build
18
19 test:
20 go test -race ./...
21
22 fmt:
23 @gofmt -l -w $(SRC)
24
25 simplify:
26 @gofmt -s -l -w $(SRC)
27
28 lint:
29 @test -z "$(shell gofmt -l . | tee /dev/stderr)" || echo "[WARN] Fix formatting issues with 'make fmt'"
30 @golint -set_exit_status $(PKGS)
31 @go vet $(PKGS)
32
33 reflex:
34 reflex -r '\.go$$' -- sh -c 'echo; date; echo; go test ./... && echo ALL PASS'