瀏覽代碼

Add "gofmt" from Go 1.3.3

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Tianon Gravi 10 年之前
父節點
當前提交
b20363c4c0
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 4 0
      Dockerfile
  2. 1 4
      api/client/utils.go

+ 4 - 0
Dockerfile

@@ -99,6 +99,10 @@ RUN cd /usr/local/go/src \
 # Reinstall standard library with netgo
 # Reinstall standard library with netgo
 RUN go clean -i net && go install -tags netgo std
 RUN go clean -i net && go install -tags netgo std
 
 
+# We still support compiling with older Go, so need to grab older "gofmt"
+ENV GOFMT_VERSION 1.3.3
+RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt
+
 # Grab Go's cover tool for dead-simple code coverage testing
 # Grab Go's cover tool for dead-simple code coverage testing
 RUN go get golang.org/x/tools/cmd/cover
 RUN go get golang.org/x/tools/cmd/cover
 
 

+ 1 - 4
api/client/utils.go

@@ -260,10 +260,7 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error {
 	sigchan := make(chan os.Signal, 1)
 	sigchan := make(chan os.Signal, 1)
 	gosignal.Notify(sigchan, signal.SIGWINCH)
 	gosignal.Notify(sigchan, signal.SIGWINCH)
 	go func() {
 	go func() {
-		// This tmp := range..., _ = tmp workaround is needed to
-		// suppress gofmt warnings while still preserve go1.3 compatibility
-		for tmp := range sigchan {
-			_ = tmp
+		for _ := range sigchan {
 			cli.resizeTty(id, isExec)
 			cli.resizeTty(id, isExec)
 		}
 		}
 	}()
 	}()