Skip to content

Commit 19646e4

Browse files
committed
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 <[email protected]>
1 parent 2a9574d commit 19646e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22

3-
FMT="*.go"
4-
53
echo "Running tests..."
64
go test -v -cover -cpu 1,2,4 ./...
75
go test -v -cover -cpu 1,2,4 -race ./...
86

97
echo "Checking gofmt..."
10-
fmt_res=$(gofmt -l -s $FMT)
8+
# We utilize 'go fmt' to find all files suitable for formatting,
9+
# but reuse full power gofmt to perform just RO check.
10+
fmt_res=$(go fmt -n ./... | sed 's| -w | -d |g' | sh)
1111
if [ -n "${fmt_res}" ]; then
1212
echo -e "gofmt checking failed:\n${fmt_res}"
1313
exit 1

0 commit comments

Comments
 (0)