Skip to content

Commit a5c136c

Browse files
authored
Merge pull request #61 from multiformats/fix/global-multiaddr-registry
fix: use global multiaddr definitions
2 parents 60a5916 + de67c9b commit a5c136c

File tree

5 files changed

+10
-28
lines changed

5 files changed

+10
-28
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
language: go
55

66
go:
7-
- 1.11.x
7+
- 1.12.x
88

99
env:
1010
global:

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# go-multiaddr-net
22

3-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
3+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
44
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)
55
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)
66
[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
@@ -35,21 +35,7 @@ Note that `go-multiaddr-net` is packaged with Gx, so it is recommended to use Gx
3535

3636
## Usage
3737

38-
This module is packaged with [Gx](https://github.com/whyrusleeping/gx). In order to use it in your own project do:
39-
40-
```sh
41-
go get -u github.com/whyrusleeping/gx
42-
go get -u github.com/whyrusleeping/gx-go
43-
cd <your-project-repository>
44-
gx init
45-
gx import github.com/multiformats/go-multiaddr-net
46-
gx install --global
47-
gx-go --rewrite
48-
```
49-
50-
Please check [Gx](https://github.com/whyrusleeping/gx) and [Gx-go](https://github.com/whyrusleeping/gx-go) documentation for more information.
51-
52-
For further usage, see the docs:
38+
See the docs:
5339

5440
- `multiaddr/net`: https://godoc.org/github.com/multiformats/go-multiaddr-net
5541
- `multiaddr`: https://godoc.org/github.com/multiformats/go-multiaddr

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)