From cf5febad47d25bee8d2a5291cbab5547cb47262d Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 15 Aug 2016 08:37:32 +0200 Subject: [PATCH] build, cmd, lib: Minimum supported compiler version is Go 1.5 --- build.go | 2 +- cmd/stfinddevice/main.go | 2 +- cmd/strelaysrv/main.go | 2 +- cmd/stvanity/main.go | 2 +- cmd/syncthing/gui_solaris.go | 2 +- cmd/syncthing/gui_unix.go | 2 +- cmd/syncthing/gui_windows.go | 2 +- lib/model/queue_test.go | 2 +- lib/protocol/vector_test.go | 2 +- lib/versioner/staggered.go | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.go b/build.go index 8ce8a575d..fc1ac9a1b 100644 --- a/build.go +++ b/build.go @@ -168,7 +168,7 @@ func init() { targets["syncthing"] = syncthingPkg } -const minGoVersion = 1.3 +const minGoVersion = 1.5 func main() { log.SetOutput(os.Stdout) diff --git a/cmd/stfinddevice/main.go b/cmd/stfinddevice/main.go index c4ee8ddfb..5364018b3 100644 --- a/cmd/stfinddevice/main.go +++ b/cmd/stfinddevice/main.go @@ -66,7 +66,7 @@ func checkServers(deviceID protocol.DeviceID, servers ...string) { }() } - for _ = range servers { + for range servers { res := <-resc u, _ := url.Parse(res.server) diff --git a/cmd/strelaysrv/main.go b/cmd/strelaysrv/main.go index 272d1c3dd..392712570 100644 --- a/cmd/strelaysrv/main.go +++ b/cmd/strelaysrv/main.go @@ -212,7 +212,7 @@ func main() { func monitorLimits() { limitCheckTimer = time.NewTimer(time.Minute) - for _ = range limitCheckTimer.C { + for range limitCheckTimer.C { if atomic.LoadInt64(&numConnections)+atomic.LoadInt64(&numProxies) > descriptorLimit { atomic.StoreInt32(&overLimit, 1) log.Println("Gone past our connection limits. Starting to refuse new/drop idle connections.") diff --git a/cmd/stvanity/main.go b/cmd/stvanity/main.go index 4fc84b6be..c96612fca 100644 --- a/cmd/stvanity/main.go +++ b/cmd/stvanity/main.go @@ -130,7 +130,7 @@ func printProgress(prefix string, count *int64) { expectedIterations := float64(int(1) << uint(wantBits)) fmt.Printf("Want %d bits for prefix %q, about %.2g certs to test (statistically speaking)\n", wantBits, prefix, expectedIterations) - for _ = range time.NewTicker(15 * time.Second).C { + for range time.NewTicker(15 * time.Second).C { tried := atomic.LoadInt64(count) elapsed := time.Since(started) rate := float64(tried) / elapsed.Seconds() diff --git a/cmd/syncthing/gui_solaris.go b/cmd/syncthing/gui_solaris.go index 3db979f2f..84574dbee 100644 --- a/cmd/syncthing/gui_solaris.go +++ b/cmd/syncthing/gui_solaris.go @@ -78,7 +78,7 @@ func trackCPUUsage() { var prevTime = time.Now().UnixNano() var rusage prusage_t var pid = os.Getpid() - for _ = range time.NewTicker(time.Second).C { + for range time.NewTicker(time.Second).C { err := solarisPrusage(pid, &rusage) if err != nil { l.Warnln("getting prusage:", err) diff --git a/cmd/syncthing/gui_unix.go b/cmd/syncthing/gui_unix.go index 4b638c408..cb0a0f221 100644 --- a/cmd/syncthing/gui_unix.go +++ b/cmd/syncthing/gui_unix.go @@ -21,7 +21,7 @@ func trackCPUUsage() { var prevUsage int64 var prevTime = time.Now().UnixNano() var rusage syscall.Rusage - for _ = range time.NewTicker(time.Second).C { + for range time.NewTicker(time.Second).C { syscall.Getrusage(syscall.RUSAGE_SELF, &rusage) curTime := time.Now().UnixNano() timeDiff := curTime - prevTime diff --git a/cmd/syncthing/gui_windows.go b/cmd/syncthing/gui_windows.go index c4afeb1a1..d933f2c51 100644 --- a/cmd/syncthing/gui_windows.go +++ b/cmd/syncthing/gui_windows.go @@ -34,7 +34,7 @@ func trackCPUUsage() { prevTime := ctime.Nanoseconds() prevUsage := ktime.Nanoseconds() + utime.Nanoseconds() // Always overflows - for _ = range time.NewTicker(time.Second).C { + for range time.NewTicker(time.Second).C { err := syscall.GetProcessTimes(handle, &ctime, &etime, &ktime, &utime) if err != nil { continue diff --git a/lib/model/queue_test.go b/lib/model/queue_test.go index fb75e8059..d2c035fbf 100644 --- a/lib/model/queue_test.go +++ b/lib/model/queue_test.go @@ -273,7 +273,7 @@ func BenchmarkJobQueuePushPopDone10k(b *testing.B) { for _, f := range files { q.Push(f.Name, 0, time.Time{}) } - for _ = range files { + for range files { n, _ := q.Pop() q.Done(n) } diff --git a/lib/protocol/vector_test.go b/lib/protocol/vector_test.go index 7918cfbde..d0f9c219e 100644 --- a/lib/protocol/vector_test.go +++ b/lib/protocol/vector_test.go @@ -144,7 +144,7 @@ func TestCompare(t *testing.T) { // Empty vectors are identical {Vector{}, Vector{}, Equal}, {Vector{}, Vector{[]Counter{{42, 0}}}, Equal}, - {Vector{[]Counter{Counter{42, 0}}}, Vector{}, Equal}, + {Vector{[]Counter{{42, 0}}}, Vector{}, Equal}, // Zero is the implied value for a missing Counter { diff --git a/lib/versioner/staggered.go b/lib/versioner/staggered.go index 58dc8a870..2517b34d2 100644 --- a/lib/versioner/staggered.go +++ b/lib/versioner/staggered.go @@ -77,7 +77,7 @@ func NewStaggered(folderID, folderPath string, params map[string]string) Version if testCleanDone != nil { close(testCleanDone) } - for _ = range time.Tick(time.Duration(cleanInterval) * time.Second) { + for range time.Tick(time.Duration(cleanInterval) * time.Second) { s.clean() } }()