mirror of https://github.com/etcd-io/protodoc.git
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:
parent
2a9574d4ff
commit
19646e4e9b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue