diff --git a/api/server/server.go b/api/server/server.go index fd13489a83..ece602160a 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -1218,7 +1218,7 @@ func ServeFd(addr string, handle http.Handler) error { }() } - for i := 0; i < len(ls); i += 1 { + for i := 0; i < len(ls); i++ { err := <-chErrors if err != nil { return err @@ -1366,7 +1366,7 @@ func ServeApi(job *engine.Job) engine.Status { }() } - for i := 0; i < len(protoAddrs); i += 1 { + for i := 0; i < len(protoAddrs); i++ { err := <-chErrors if err != nil { return job.Error(err) diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go index 42315c6e82..bb7b07a96d 100644 --- a/daemon/graphdriver/devmapper/deviceset.go +++ b/daemon/graphdriver/devmapper/deviceset.go @@ -832,7 +832,7 @@ func (devices *DeviceSet) waitRemove(devname string) error { log.Debugf("[deviceset %s] waitRemove(%s)", devices.devicePrefix, devname) defer log.Debugf("[deviceset %s] waitRemove(%s) END", devices.devicePrefix, devname) i := 0 - for ; i < 1000; i += 1 { + for ; i < 1000; i++ { devinfo, err := getInfo(devname) if err != nil { // If there is an error we assume the device doesn't exist. @@ -861,7 +861,7 @@ func (devices *DeviceSet) waitRemove(devname string) error { // or b) the 10 second timeout expires. func (devices *DeviceSet) waitClose(info *DevInfo) error { i := 0 - for ; i < 1000; i += 1 { + for ; i < 1000; i++ { devinfo, err := getInfo(info.Name()) if err != nil { return err diff --git a/pkg/httputils/resumablerequestreader.go b/pkg/httputils/resumablerequestreader.go index 71533d37c9..3cd1f49179 100644 --- a/pkg/httputils/resumablerequestreader.go +++ b/pkg/httputils/resumablerequestreader.go @@ -46,7 +46,7 @@ func (r *resumableRequestReader) Read(p []byte) (n int, err error) { } if err != nil && r.failures+1 != r.maxFailures { r.cleanUpResponse() - r.failures += 1 + r.failures++ time.Sleep(5 * time.Duration(r.failures) * time.Second) return 0, nil } else if err != nil {