From 7094c78dcd9991868e52fce09c789a9472289871 Mon Sep 17 00:00:00 2001 From: Hitoshi Mitake Date: Fri, 4 Dec 2015 10:12:05 +0900 Subject: [PATCH] test: print diff with gofmt Current test doesn't pass -d option to gofmt. Let's pass the option for easy fix. Example output: Checking gofmt... gofmt checking failed: client/client.go diff client/client.go gofmt/client/client.go --- /tmp/gofmt741496847 2015-12-04 10:11:11.340651702 +0900 +++ /tmp/gofmt265273890 2015-12-04 10:11:11.340651702 +0900 @@ -41,7 +41,7 @@ var DefaultTransport CancelableTransport = &http.Transport{ Proxy: http.ProxyFromEnvironment, - Dial:(&net.Dialer{ + Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).Dial, @@ -265,7 +265,7 @@ return ErrNoEndpoints } - for i, _ := range c.endpoints { + for i := range c.endpoints { if c.endpoints[i].String() == lu.String() { c.pinned = i break --- test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test b/test index 658ea3314..69d91f0de 100755 --- a/test +++ b/test @@ -61,7 +61,7 @@ if [ -n "$INTEGRATION" ]; then fi echo "Checking gofmt..." -fmtRes=$(gofmt -l -s $FMT) +fmtRes=$(gofmt -l -s -d $FMT) if [ -n "${fmtRes}" ]; then echo -e "gofmt checking failed:\n${fmtRes}" exit 255