ipld-eth-server/vendor/github.com/ipfs/go-ipfs/bin/test-go-fmt
2019-12-02 13:24:46 -06:00

16 lines
353 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
T="$(mktemp)"
find . -name '*.go' | xargs gofmt -l > "$T"
if [ -n "$(cat $T)" ]; then
echo "Following Go code is not formatted."
echo "-----------------------------------"
cat "$T"
echo "-----------------------------------"
echo "Run 'go fmt ./...' in your source directory"
rm -f "$T"
exit 1
fi
rm -f "$T"