From fb0187b19742bc2fe9e52f3809c1d194fe207c85 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Mon, 25 Aug 2014 12:35:40 -0700 Subject: [PATCH 1/2] gofmt: sort --- network/interface.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/interface.go b/network/interface.go index 691323a..d3a6f9d 100644 --- a/network/interface.go +++ b/network/interface.go @@ -2,9 +2,9 @@ package network import ( "fmt" + "sort" "strconv" "strings" - "sort" ) type InterfaceGenerator interface { From e90fe3eba8897bbfec6cf73915724031009665d0 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Mon, 25 Aug 2014 12:36:04 -0700 Subject: [PATCH 2/2] test: Add gofmt to test --- test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test b/test index 65d2fb8..0d0a7a9 100755 --- a/test +++ b/test @@ -26,9 +26,9 @@ declare -a TESTPKGS=(initialize network) if [ -z "$PKG" ]; then - GOFMTPATH="$TESTPKGS coreos-cloudinit.go" + GOFMTPATH="${TESTPKGS[*]} coreos-cloudinit.go" # prepend repo path to each package - TESTPKGS="${TESTPKGS[@]/#/${REPO_PATH}/} ./" + TESTPKGS="${TESTPKGS[*]/#/${REPO_PATH}/} ./" else GOFMTPATH="$TESTPKGS" # strip out slashes and dots from PKG=./foo/ @@ -43,5 +43,9 @@ go test ${COVER} $@ ${TESTPKGS} echo "Checking gofmt..." fmtRes=$(gofmt -l $GOFMTPATH) +if [ -n "$fmtRes" ]; then + echo "$fmtRes" + exit 1 +fi echo "Success"