2020-12-08 18:23:35 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-30 18:26:25 +03:00
|
|
|
verbose="${VERBOSE:-0}"
|
2021-05-19 20:31:20 +03:00
|
|
|
readonly verbose
|
2020-12-30 18:26:25 +03:00
|
|
|
|
2021-01-15 20:30:48 +03:00
|
|
|
if [ "$verbose" -gt '1' ]
|
2020-12-30 18:26:25 +03:00
|
|
|
then
|
|
|
|
set -x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags='-x'
|
2021-01-15 20:30:48 +03:00
|
|
|
elif [ "$verbose" -gt '0' ]
|
|
|
|
then
|
|
|
|
set -x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags='-v'
|
|
|
|
x_flags=''
|
2021-01-15 20:30:48 +03:00
|
|
|
else
|
|
|
|
set +x
|
2021-05-19 20:31:20 +03:00
|
|
|
v_flags=''
|
|
|
|
x_flags=''
|
2020-12-30 18:26:25 +03:00
|
|
|
fi
|
2021-05-19 20:31:20 +03:00
|
|
|
readonly v_flags x_flags
|
2020-12-30 18:26:25 +03:00
|
|
|
|
2020-12-08 18:23:35 +03:00
|
|
|
set -e -f -u
|
|
|
|
|
2021-01-15 20:30:48 +03:00
|
|
|
go="${GO:-go}"
|
2021-05-19 20:31:20 +03:00
|
|
|
readonly go
|
2021-01-15 20:30:48 +03:00
|
|
|
|
2020-12-08 18:23:35 +03:00
|
|
|
# TODO(a.garipov): Add goconst?
|
|
|
|
|
2021-01-15 20:30:48 +03:00
|
|
|
# Reset GOARCH and GOOS to make sure we install the tools for the native
|
2021-05-19 20:31:20 +03:00
|
|
|
# architecture even when we're cross-compiling the main binary, and also to
|
|
|
|
# prevent the "cannot install cross-compiled binaries when GOBIN is set" error.
|
2021-01-15 20:30:48 +03:00
|
|
|
env\
|
|
|
|
GOARCH=""\
|
|
|
|
GOBIN="${PWD}/bin"\
|
2022-09-07 18:03:18 +03:00
|
|
|
GOOS=""\
|
|
|
|
GOWORK='off'\
|
|
|
|
"$go" install\
|
|
|
|
--modfile=./internal/tools/go.mod\
|
|
|
|
$v_flags\
|
|
|
|
$x_flags\
|
2020-12-08 18:23:35 +03:00
|
|
|
github.com/fzipp/gocyclo/cmd/gocyclo\
|
|
|
|
github.com/golangci/misspell/cmd/misspell\
|
|
|
|
github.com/gordonklaus/ineffassign\
|
|
|
|
github.com/kisielk/errcheck\
|
|
|
|
github.com/kyoh86/looppointer/cmd/looppointer\
|
|
|
|
github.com/securego/gosec/v2/cmd/gosec\
|
|
|
|
golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness\
|
|
|
|
golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow\
|
2022-09-07 18:03:18 +03:00
|
|
|
golang.org/x/vuln/cmd/govulncheck\
|
2020-12-08 18:23:35 +03:00
|
|
|
honnef.co/go/tools/cmd/staticcheck\
|
|
|
|
mvdan.cc/gofumpt\
|
|
|
|
mvdan.cc/unparam\
|
|
|
|
;
|