| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # exclude vendor/ |
| 4 | SOURCES="*.go internal/ example/" |
| 5 | |
| 6 | if [scip-shell system . . `[`. "$1" = "--fix" ]; then |
| 7 | exec gofmt -s -w $SOURCES |
| 8 | fi |
| 9 | |
| 10 | if [scip-shell system . . `[`. -n "$(gofmtscip-shell system . . gofmt. -s -l $SOURCES)" ]; then |
| 11 | echoscip-shell system . . echo. "Go code is not formatted correctly with \`gofmt -s\`:" |
| 12 | gofmtscip-shell system . . gofmt. -s -d $SOURCES |
| 13 | exit 1 |
| 14 | fi |