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
dms3
go-cidutil
Commits
bae78f13
Commit
bae78f13
authored
Mar 18, 2017
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add an example to the tests to play around with the feature
parent
cdef63fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
set.go
set.go
+2
-2
No files found.
set.go
View file @
bae78f13
...
@@ -27,7 +27,7 @@ func (s *Set) Len() int {
...
@@ -27,7 +27,7 @@ func (s *Set) Len() int {
func
(
s
*
Set
)
Keys
()
[]
*
Cid
{
func
(
s
*
Set
)
Keys
()
[]
*
Cid
{
out
:=
make
([]
*
Cid
,
0
,
len
(
s
.
set
))
out
:=
make
([]
*
Cid
,
0
,
len
(
s
.
set
))
for
k
,
_
:=
range
s
.
set
{
for
k
:=
range
s
.
set
{
c
,
_
:=
Cast
([]
byte
(
k
))
c
,
_
:=
Cast
([]
byte
(
k
))
out
=
append
(
out
,
c
)
out
=
append
(
out
,
c
)
}
}
...
@@ -44,7 +44,7 @@ func (s *Set) Visit(c *Cid) bool {
...
@@ -44,7 +44,7 @@ func (s *Set) Visit(c *Cid) bool {
}
}
func
(
s
*
Set
)
ForEach
(
f
func
(
c
*
Cid
)
error
)
error
{
func
(
s
*
Set
)
ForEach
(
f
func
(
c
*
Cid
)
error
)
error
{
for
cs
,
_
:=
range
s
.
set
{
for
cs
:=
range
s
.
set
{
c
,
_
:=
Cast
([]
byte
(
cs
))
c
,
_
:=
Cast
([]
byte
(
cs
))
err
:=
f
(
c
)
err
:=
f
(
c
)
if
err
!=
nil
{
if
err
!=
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