-
Notifications
You must be signed in to change notification settings - Fork 75
/
goclean.sh
executable file
·22 lines (18 loc) · 809 Bytes
/
goclean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http:https://golang.org/cmd/gofmt/)
# 2. go vet (http:https://golang.org/cmd/vet)
# 3. gosimple (https://github.com/dominikh/go-simple)
# 4. unconvert (https://github.com/mdempsky/unconvert)
# 5. ineffassign (https://github.com/gordonklaus/ineffassign)
# 6. misspell (https://github.com/client9/misspell)
# 7. bodyclose (https://github.com/timakin/bodyclose)
# 8. race detector (http:https://blog.golang.org/race-detector)
# 9. test coverage (http:https://blog.golang.org/cover)
set -ex
# run tests
env GORACE="halt_on_error=1" go test -short -race ./...
# golangci-lint (github.com/golangci/golangci-lint) is used to run each each
# static checker.
# check linters
golangci-lint run