2015-12-17 18:21:43 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-12-02 18:02:33 +01:00
|
|
|
# Check go fmt
|
|
|
|
echo "==> Checking that code complies with go fmt requirements..."
|
|
|
|
gofmt_files=$(go fmt ./...)
|
2015-12-17 18:21:43 +01:00
|
|
|
if [[ -n ${gofmt_files} ]]; then
|
|
|
|
echo 'gofmt needs running on the following files:'
|
|
|
|
echo "${gofmt_files}"
|
2020-12-02 18:02:33 +01:00
|
|
|
echo "You can use the command: \`go fmt\` to reformat code."
|
2015-12-17 18:21:43 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|