Ensure all files are covered by go fmt

The current approach was only running go fmt on the top-level *.go
files.

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2025-02-28 11:38:54 -08:00
parent 2a9574d4ff
commit 19646e4e9b
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5
1 changed files with 3 additions and 3 deletions

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
FMT="*.go"
echo "Running tests..."
go test -v -cover -cpu 1,2,4 ./...
go test -v -cover -cpu 1,2,4 -race ./...
echo "Checking gofmt..."
fmt_res=$(gofmt -l -s $FMT)
# We utilize 'go fmt' to find all files suitable for formatting,
# but reuse full power gofmt to perform just RO check.
fmt_res=$(go fmt -n ./... | sed 's| -w | -d |g' | sh)
if [ -n "${fmt_res}" ]; then
echo -e "gofmt checking failed:\n${fmt_res}"
exit 1