aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 1ee128f3b4a9ba5a86da51fdd8a850caad55aa7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
TARGET = go-example 
RUN_MODE ?= development 
GO ?= go 
 
$(TARGET): */*.go go.sum
$(GO) build -o $@ ./cmd/main/
 
.PHONY: test
test:
$(GO) test -cover -coverprofile=coverage.out -v ./...
$(GO) tool cover -html=coverage.out -o cover.html
rm coverage.out
 
.PHONY: lint
lint: fmt
~/go/bin/golangci-lint run -v
 
.PHONY: clean
clean:
rm $(TARGET)
 
.PHONY: fmt
fmt:
~/go/bin/goimports -local www.thenautilus.net/cgit -w .
~/go/bin/gci write -s Standard -s Default -s 'Prefix(www.thenautilus.net/cgit)' .
~/go/bin/gofumpt -l -w .
 
.PHONY: run
run: $(TARGET)
./$(TARGET) --verbose --log-format=console $(ARGS)
 
.PHONY: update
update:
go get -u -t ./...