Skip to content

Commit

Permalink
Changing pre-commit to fail if files are not gofmt'ed
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed Oct 6, 2016
1 parent c0f6a79 commit 66da1b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
#!/bin/bash

# Exit on first error.
set -e

go test ./...

gofmt -s -d .
# Make sure there is no output from gofmt.
gofmt -s -d . 2>&1 | read && (echo 'error: not formatted' || exit 1)

go vet ./...

Expand Down

0 comments on commit 66da1b7

Please sign in to comment.