Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
81e75c71
Commit
81e75c71
authored
Sep 28, 2014
by
Emery Hemingway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipv6 support for DialArgs
parent
baeeb60a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
index.go
index.go
+8
-1
No files found.
index.go
View file @
81e75c71
...
...
@@ -93,7 +93,14 @@ func (m *Multiaddr) DialArgs() (string, string, error) {
parts
:=
strings
.
Split
(
str
,
"/"
)[
1
:
]
network
:=
parts
[
2
]
host
:=
strings
.
Join
([]
string
{
parts
[
1
],
parts
[
3
]},
":"
)
var
host
string
switch
parts
[
0
]
{
case
"ip4"
:
host
=
strings
.
Join
([]
string
{
parts
[
1
],
parts
[
3
]},
":"
)
case
"ip6"
:
host
=
fmt
.
Sprintf
(
"[%s]:%s"
,
parts
[
1
],
parts
[
3
])
}
return
network
,
host
,
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment