Update staticcheck version and fix all warnings (#1381)

This commit is contained in:
Ta-Ching Chen
2019-11-05 18:09:12 +08:00
committed by GitHub
parent 93d4b88d84
commit b9a5588ca9
43 changed files with 122 additions and 219 deletions
+3 -3
View File
@@ -31,9 +31,9 @@ func checkErr(err error) {
func TestCache(t *testing.T) {
c := MakeCache(100*time.Millisecond, 100*time.Millisecond)
err, _ := c.Set("a", "b")
_, err := c.Set("a", "b")
checkErr(err)
err, _ = c.Set("p", "q")
_, err = c.Set("p", "q")
checkErr(err)
val, err := c.Get("a")
@@ -55,7 +55,7 @@ func TestCache(t *testing.T) {
log.Panicf("found deleted element")
}
err, _ = c.Set("expires", "42")
_, err = c.Set("expires", "42")
checkErr(err)
time.Sleep(150 * time.Millisecond)
_, err = c.Get("expires")