-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_tests.sh
36 lines (29 loc) · 1.17 KB
/
run_tests.sh
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
#!/usr/bin/env bash
# usage:
# ./run_tests.sh # local, go 1.11
# GOVERSION=1.10 ./run_tests.sh # local, go 1.10 (vgo)
# ./run_tests.sh docker # docker, go 1.11
# GOVERSION=1.10 ./run_tests.sh docker # docker, go 1.10 (vgo)
# ./run_tests.sh podman # podman, go 1.11
# GOVERSION=1.10 ./run_tests.sh podman # podman, go 1.10 (vgo)
set -ex
# The script does automatic checking on a Go package and its sub-packages,
# including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. gosimple (https://github.com/dominikh/go-simple)
# 3. unconvert (https://github.com/mdempsky/unconvert)
# 4. ineffassign (https://github.com/gordonklaus/ineffassign)
# 5. race detector (http://blog.golang.org/race-detector)
# gometalinter (github.com/alecthomas/gometalinter) is used to run each each
# static checker.
# To run on docker on windows, symlink /mnt/c to /c and then execute the script
# from the repo path under /c. See:
# https://github.com/Microsoft/BashOnWindows/issues/1854
# for more details.
GO111MODULE=on
go version
go env
go clean -testcache
go build -v ./...
go test ./...
go install . ./cmd/...