gofmt.sh 206 B

1234567
  1. #!/bin/bash
  2. set -ev
  3. # Only check for go1.10+ since the gofmt style changed
  4. if [[ $(go version) =~ go1\.([0-9]+) ]] && ((${BASH_REMATCH[1]} >= 10)); then
  5. test -z "$(gofmt -d -s . | tee /dev/stderr)"
  6. fi