Skip to content

Commit 4e1f0dd

Browse files
committed
INF-1307 enforce gofmt -s in lint.sh
gofmt without -s misses simplifications (range over int, redundant slice expressions, type elision in composite literals). Add the flag so the lint job catches them going forward. No code change needed - tree was already clean under -s.
1 parent 268ed5e commit 4e1f0dd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/lint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ cd "${ROOT}"
1010
# scratch directory.
1111
mapfile -t GO_FILES < <(find . -name "*.go" -not -name "zz_generated.go" -not -path "./.build/*")
1212

13-
echo "==> gofmt"
14-
unformatted="$(gofmt -l "${GO_FILES[@]}" || true)"
13+
echo "==> gofmt -s"
14+
unformatted="$(gofmt -s -l "${GO_FILES[@]}" || true)"
1515
if [[ -n "${unformatted}" ]]; then
16-
echo "gofmt needs to run on:"
16+
echo "gofmt -s needs to run on:"
1717
echo "${unformatted}"
1818
exit 1
1919
fi

0 commit comments

Comments
 (0)