2022-01-31 23:24:16 +00:00
|
|
|
description: Ensure go formatting is correct.
|
|
|
|
executor: go-machine
|
|
|
|
steps:
|
|
|
|
# Setup Go enabling the proxy for downloading modules.
|
|
|
|
- setup-go:
|
|
|
|
GOPROXY: https://proxy.golang.org,direct
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: make fmt
|
|
|
|
command: |
|
2022-09-08 00:31:20 +00:00
|
|
|
echo "Using gofumpt version ${GOFUMPT_VERSION}"
|
2022-01-31 23:24:16 +00:00
|
|
|
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
|
|
|
|
make fmt
|
|
|
|
if ! git diff --exit-code; then
|
|
|
|
echo "Code has formatting errors. Run 'make fmt' to fix"
|
|
|
|
exit 1
|
|
|
|
fi
|