mirror of
https://github.com/libp2p/go-libp2p.git
synced 2026-04-23 00:27:05 +08:00
refactor: apply go fix modernizers from Go 1.26 (#3463)
Co-authored-by: sukun <sukunrt@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -442,12 +443,7 @@ func TestHostProtoPreknowledge(t *testing.T) {
|
||||
require.Never(t, func() bool {
|
||||
protos, err := h1.Peerstore().GetProtocols(h2.ID())
|
||||
require.NoError(t, err)
|
||||
for _, p := range protos {
|
||||
if p == "/foo" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(protos, "/foo")
|
||||
}, time.Second, 100*time.Millisecond)
|
||||
|
||||
s, err := h1.NewStream(context.Background(), h2.ID(), "/foo", "/bar", "/super")
|
||||
|
||||
Reference in New Issue
Block a user