1
1
mirror of https://github.com/walles/moar.git synced 2024-10-26 13:00:40 +03:00

Add gomft -s flag

Adds code simplifications. Recommended online somewhere.
This commit is contained in:
Johan Walles 2021-04-19 15:18:51 +02:00
parent 1e211974e1
commit d122901ca8
2 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,7 @@
if [ -z ${CI+x} ]; then
# Local build, not in CI, format source
go fmt .
gofmt -s -w .
fi
VERSION="$(git describe --tags --dirty --always)"

View File

@ -9,8 +9,8 @@ grep -En 'Background\([1-9]' ./*.go ./*/*.go && exit 1
# Compile test first
./build.sh
# Linting first
MISFORMATTED="$(gofmt -l .)"
# Linting
MISFORMATTED="$(gofmt -l -s .)"
if [ -n "$MISFORMATTED" ]; then
echo >&2 "==="
echo >&2 "ERROR: The following files are not formatted, run './build.sh', './test.sh' or 'go fmt .' to fix:"
@ -19,6 +19,10 @@ if [ -n "$MISFORMATTED" ]; then
exit 1
fi
# FIXME: Add "go vet", catches fmt-placeholders-vs-args problems
# FIXME: Add https://staticcheck.io/docs/
# FIXME: Add https://github.com/kisielk/errcheck
# Unit tests first
go test -timeout 20s ./...