Fix govet+staticcheck issues (#20263)

This is better: https://github.com/golang/go/issues/60529
This commit is contained in:
Klaus Post
2024-08-14 10:11:51 -07:00
committed by GitHub
parent 51b1f41518
commit 3ffeabdfcb
16 changed files with 49 additions and 37 deletions

View File

@@ -18,7 +18,6 @@
package pubsub
import (
"fmt"
"testing"
"time"
)
@@ -138,7 +137,7 @@ func TestPubSub(t *testing.T) {
ps.Publish(val)
msg := <-ch1
if msg != val {
t.Fatalf(fmt.Sprintf("expected %s , found %s", val, msg))
t.Fatalf("expected %s , found %s", val, msg)
}
}
@@ -160,7 +159,7 @@ func TestMultiPubSub(t *testing.T) {
msg1 := <-ch1
msg2 := <-ch2
if msg1 != val && msg2 != val {
t.Fatalf(fmt.Sprintf("expected both subscribers to have%s , found %s and %s", val, msg1, msg2))
t.Fatalf("expected both subscribers to have%s , found %s and %s", val, msg1, msg2)
}
}
@@ -189,12 +188,12 @@ func TestMultiPubSubMask(t *testing.T) {
msg1 := <-ch1
msg2 := <-ch2
if msg1 != val && msg2 != val {
t.Fatalf(fmt.Sprintf("expected both subscribers to have%s , found %s and %s", val, msg1, msg2))
t.Fatalf("expected both subscribers to have%s , found %s and %s", val, msg1, msg2)
}
select {
case msg := <-ch3:
t.Fatalf(fmt.Sprintf("unexpected msg, f got %s", msg))
t.Fatalf("unexpected msg, f got %s", msg)
default:
}
}