From 19646e4e9b1c6b4311f8c50157ba3b32e723ea6b Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Fri, 28 Feb 2025 11:38:54 -0800 Subject: [PATCH] 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 --- scripts/test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 1037381..ccc0ab3 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -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