You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
310 B

  1. #!/bin/bash
  2. # This script is used by the CI to check if the code is gofmt formatted.
  3. set -euo pipefail
  4. GOFMT_DIFF=$(IFS=$'\n'; gofmt -d $( find . -type f -name '*.go' ) )
  5. if [[ -n "${GOFMT_DIFF}" ]]; then
  6. echo "${GOFMT_DIFF}"
  7. echo
  8. echo "The go source files aren't gofmt formatted."
  9. exit 1
  10. fi