diff --git a/go.mod b/go.mod index cedf6e4..471deb4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/multiformats/go-multiaddr -go 1.13 +go 1.15 require ( github.com/ipfs/go-cid v0.0.7 diff --git a/multiaddr_test.go b/multiaddr_test.go index 3e595a6..e20a474 100644 --- a/multiaddr_test.go +++ b/multiaddr_test.go @@ -346,12 +346,12 @@ func TestProtocols(t *testing.T) { func TestProtocolsWithString(t *testing.T) { pwn := ProtocolWithName good := map[string][]Protocol{ - "/ip4": []Protocol{pwn("ip4")}, - "/ip4/tcp": []Protocol{pwn("ip4"), pwn("tcp")}, - "ip4/tcp/udp/ip6": []Protocol{pwn("ip4"), pwn("tcp"), pwn("udp"), pwn("ip6")}, - "////////ip4/tcp": []Protocol{pwn("ip4"), pwn("tcp")}, - "ip4/udp/////////": []Protocol{pwn("ip4"), pwn("udp")}, - "////////ip4/tcp////////": []Protocol{pwn("ip4"), pwn("tcp")}, + "/ip4": {pwn("ip4")}, + "/ip4/tcp": {pwn("ip4"), pwn("tcp")}, + "ip4/tcp/udp/ip6": {pwn("ip4"), pwn("tcp"), pwn("udp"), pwn("ip6")}, + "////////ip4/tcp": {pwn("ip4"), pwn("tcp")}, + "ip4/udp/////////": {pwn("ip4"), pwn("udp")}, + "////////ip4/tcp////////": {pwn("ip4"), pwn("tcp")}, } for s, ps1 := range good { diff --git a/util_test.go b/util_test.go index 3793a31..4976d7d 100644 --- a/util_test.go +++ b/util_test.go @@ -12,10 +12,10 @@ func TestSplitFirstLast(t *testing.T) { ipfsStr := "/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7" for _, x := range [][]string{ - []string{ipStr, tcpStr, quicStr, ipfsStr}, - []string{ipStr, tcpStr, ipfsStr}, - []string{ipStr, tcpStr}, - []string{ipStr}, + {ipStr, tcpStr, quicStr, ipfsStr}, + {ipStr, tcpStr, ipfsStr}, + {ipStr, tcpStr}, + {ipStr}, } { addr := StringCast(strings.Join(x, "")) head, tail := SplitFirst(addr) @@ -110,10 +110,10 @@ func TestSplitFunc(t *testing.T) { ipfsStr := "/ipfs/QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7" for _, x := range [][]string{ - []string{ipStr, tcpStr, quicStr, ipfsStr}, - []string{ipStr, tcpStr, ipfsStr}, - []string{ipStr, tcpStr}, - []string{ipStr}, + {ipStr, tcpStr, quicStr, ipfsStr}, + {ipStr, tcpStr, ipfsStr}, + {ipStr, tcpStr}, + {ipStr}, } { addr := StringCast(strings.Join(x, "")) for i, cs := range x {