-
Notifications
You must be signed in to change notification settings - Fork 37
/
.travis.yml
24 lines (20 loc) · 944 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
language: go
install: true
go:
- "1.16"
env:
- GO111MODULE=on
before_script:
- sudo apt-get -qq update
- sudo apt-get install -y libpcap-dev
- GO_FILES=$(find . -iname '*.go' -type f)
- go install golang.org/x/lint/golint@latest # Linter
- go install honnef.co/go/tools/cmd/staticcheck@latest # Badass static analyzer/linter
- go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
script:
- test -z $(gofmt -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
- go test -v -race ./... # Run all the tests with the race detector enabled
- go vet ./... # go vet is the official Go static analyzer
- staticcheck ./... # "go vet on steroids" + linter
- gocyclo -over 19 $GO_FILES # forbid code with excessively complicated functions
- golint -set_exit_status $(go list ./...) # one last linter