* Use features from Go 1.16 tooling. - GO111MODULE environment variable now defaults to "on" - "go build" and "go test" now exit with an error rather than silently modifying go.mod or go.sum files - Update README.md * Don't use deprecated ioutil package.
41 lines
799 B
Bash
Executable File
41 lines
799 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2020-2021 The Decred developers
|
|
# Use of this source code is governed by an ISC
|
|
# license that can be found in the LICENSE file.
|
|
#
|
|
# usage:
|
|
# ./run_tests.sh
|
|
|
|
set -ex
|
|
|
|
go version
|
|
|
|
# run tests
|
|
env GORACE="halt_on_error=1" go test -race ./...
|
|
|
|
# set output format for linter
|
|
if [[ -v CI ]]; then
|
|
OUT_FORMAT="github-actions"
|
|
else
|
|
OUT_FORMAT="colored-line-number"
|
|
fi
|
|
|
|
# run linter
|
|
golangci-lint run --disable-all --deadline=10m \
|
|
--out-format=$OUT_FORMAT \
|
|
--enable=gofmt \
|
|
--enable=revive \
|
|
--enable=govet \
|
|
--enable=gosimple \
|
|
--enable=unconvert \
|
|
--enable=ineffassign \
|
|
--enable=structcheck \
|
|
--enable=goimports \
|
|
--enable=misspell \
|
|
--enable=unparam \
|
|
--enable=deadcode \
|
|
--enable=unused \
|
|
--enable=errcheck \
|
|
--enable=asciicheck
|
|
|