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-fmt
Commits
8c6a494c
Commit
8c6a494c
authored
Jan 17, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better printing
parent
63857d12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
patterns.go
patterns.go
+2
-4
patterns_test.go
patterns_test.go
+1
-0
No files found.
patterns.go
View file @
8c6a494c
...
...
@@ -84,16 +84,14 @@ func (ptrn *pattern) String() string {
sub
=
append
(
sub
,
a
.
String
())
}
var
delim
string
switch
ptrn
.
Op
{
case
AND
:
delim
=
","
return
strings
.
Join
(
sub
,
"/"
)
case
OR
:
delim
=
"|
"
return
"{"
+
strings
.
Join
(
sub
,
"|"
)
+
"}
"
default
:
panic
(
"unrecognized pattern op!"
)
}
return
"{ "
+
strings
.
Join
(
sub
,
delim
)
+
" }"
}
type
Base
int
...
...
patterns_test.go
View file @
8c6a494c
...
...
@@ -7,6 +7,7 @@ import (
)
func
assertMatches
(
t
*
testing
.
T
,
p
Pattern
,
args
...
[]
string
)
{
t
.
Logf
(
"testing assertions for %q"
,
p
)
for
_
,
argset
:=
range
args
{
for
_
,
s
:=
range
argset
{
addr
,
err
:=
ma
.
NewMultiaddr
(
s
)
...
...
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