Unverified Commit a5c136c9 authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #61 from multiformats/fix/global-multiaddr-registry

fix: use global multiaddr definitions
parents 60a59169 de67c9ba
......@@ -4,7 +4,7 @@ os:
language: go
go:
- 1.11.x
- 1.12.x
env:
global:
......
# go-multiaddr-net
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)
[![](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
## Usage
This module is packaged with [Gx](https://github.com/whyrusleeping/gx). In order to use it in your own project do:
```sh
go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
cd <your-project-repository>
gx init
gx import github.com/multiformats/go-multiaddr-net
gx install --global
gx-go --rewrite
```
Please check [Gx](https://github.com/whyrusleeping/gx) and [Gx-go](https://github.com/whyrusleeping/gx-go) documentation for more information.
For further usage, see the docs:
See the docs:
- `multiaddr/net`: https://godoc.org/github.com/multiformats/go-multiaddr-net
- `multiaddr`: https://godoc.org/github.com/multiformats/go-multiaddr
......
......@@ -6,7 +6,6 @@ import (
"path/filepath"
ma "github.com/multiformats/go-multiaddr"
madns "github.com/multiformats/go-multiaddr-dns"
)
var errIncorrectNetAddr = fmt.Errorf("incorrect network addr conversion")
......@@ -131,12 +130,12 @@ func DialArgs(m ma.Multiaddr) (string, string, error) {
network = "ip4"
ip = c.Value()
return true
case madns.Dns4Protocol.Code:
case ma.P_DNS4:
network = "ip4"
hostname = true
ip = c.Value()
return true
case madns.Dns6Protocol.Code:
case ma.P_DNS6:
network = "ip6"
hostname = true
ip = c.Value()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment