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.

.check-gofmt.sh 263B

1234567891011121314
  1. #!/bin/bash
  2. # exclude vendor/
  3. SOURCES="./ergo.go ./irc"
  4. if [ "$1" = "--fix" ]; then
  5. exec gofmt -s -w $SOURCES
  6. fi
  7. if [ -n "$(gofmt -s -l $SOURCES)" ]; then
  8. echo "Go code is not formatted correctly with \`gofmt -s\`:"
  9. gofmt -s -d $SOURCES
  10. exit 1
  11. fi