Skip to content

Commit abe95b8

Browse files
committed
fix: use global multiaddr definitions
So we don't have to import a DNS resolver just to parse dns multiaddrs.
1 parent 082ac9f commit abe95b8

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

convert.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"path/filepath"
77

88
ma "github.com/multiformats/go-multiaddr"
9-
madns "github.com/multiformats/go-multiaddr-dns"
109
)
1110

1211
var errIncorrectNetAddr = fmt.Errorf("incorrect network addr conversion")
@@ -131,12 +130,12 @@ func DialArgs(m ma.Multiaddr) (string, string, error) {
131130
network = "ip4"
132131
ip = c.Value()
133132
return true
134-
case madns.Dns4Protocol.Code:
133+
case ma.P_DNS4:
135134
network = "ip4"
136135
hostname = true
137136
ip = c.Value()
138137
return true
139-
case madns.Dns6Protocol.Code:
138+
case ma.P_DNS6:
140139
network = "ip6"
141140
hostname = true
142141
ip = c.Value()

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module github.com/multiformats/go-multiaddr-net
22

3-
require (
4-
github.com/multiformats/go-multiaddr v0.0.1
5-
github.com/multiformats/go-multiaddr-dns v0.0.1
6-
)
3+
require github.com/multiformats/go-multiaddr v0.1.0
4+
5+
go 1.12

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16 h1:5W7KhL8HVF3XC
88
github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
99
github.com/mr-tron/base58 v1.1.0 h1:Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ=
1010
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
11-
github.com/multiformats/go-multiaddr v0.0.1 h1:/QUV3VBMDI6pi6xfiw7lr6xhDWWvQKn9udPn68kLSdY=
12-
github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44=
13-
github.com/multiformats/go-multiaddr-dns v0.0.1 h1:jQt9c6tDSdQLIlBo4tXYx7QUHCPjxsB1zXcag/2S7zc=
14-
github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q=
11+
github.com/multiformats/go-multiaddr v0.1.0 h1:fkISCUNDb3xIpCcI6BGlPsQE+ywcxzimOsUnHWnrE74=
12+
github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44=
1513
github.com/multiformats/go-multihash v0.0.1 h1:HHwN1K12I+XllBCrqKnhX949Orn4oawPkegHMu2vDqQ=
1614
github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
1715
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 h1:ng3VDlRp5/DHpSWl02R4rM9I+8M2rhmsuLwAMmkLQWE=

0 commit comments

Comments
 (0)