-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile
48 lines (44 loc) · 1.36 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# builds and tests project via go tools
all:
@echo "update dependencies"
go get -u ./...
go mod tidy
@echo "build and test"
go build -v ./...
go vet ./...
golint -set_exit_status=true ./...
staticcheck -checks all -fail none ./...
golangci-lint run ./...
@echo execute tests on latest go version
go test ./...
go test ./... -race
# @echo execute tests on older supported go versions
GOTOOLCHAIN=go1.22.8 go1.22.8 test ./...
GOTOOLCHAIN=go1.22.8 go1.22.8 test ./... -race
# @echo execute tests on future supported go versions
#see fsfe reuse tool (https://git.fsfe.org/reuse/tool)
#on linux: if pipx uses outdated packages, delete ~/.local/pipx/cache entries
@echo "reuse (license) check"
pipx run reuse lint
#go generate
generate:
@echo "generate"
go generate ./...
#install additional tools
tools:
#install stringer
@echo "install latest stringer version"
go install golang.org/x/tools/cmd/stringer@latest
#install linter
@echo "install latest go linter version"
go install golang.org/x/lint/golint@latest
#install staticcheck
@echo "install latest staticcheck version"
go install honnef.co/go/tools/cmd/staticcheck@latest
#install golangci-lint
@echo "install latest golangci-lint version"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
#install additional go versions
go:
go install golang.org/dl/go1.22.8@latest
go1.22.8 download