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-merkledag
Commits
2f6bea5f
Commit
2f6bea5f
authored
May 31, 2017
by
zramsay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply the megacheck tool to improve code quality
License: MIT Signed-off-by:
Zach Ramsay
<
zach.ramsay@gmail.com
>
parent
9947834f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
11 deletions
+2
-11
merkledag.go
merkledag.go
+0
-2
merkledag_test.go
merkledag_test.go
+0
-6
node.go
node.go
+2
-3
No files found.
merkledag.go
View file @
2f6bea5f
...
@@ -12,12 +12,10 @@ import (
...
@@ -12,12 +12,10 @@ import (
offline
"github.com/ipfs/go-ipfs/exchange/offline"
offline
"github.com/ipfs/go-ipfs/exchange/offline"
ipldcbor
"gx/ipfs/QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR/go-ipld-cbor"
ipldcbor
"gx/ipfs/QmNrbCt8j9DT5W9Pmjy2SdudT9k8GpaDr4sRuFix3BXhgR/go-ipld-cbor"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
cid
"gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid"
cid
"gx/ipfs/QmYhQaCYEcaPPjxJX7YcPcVKkQfRy6sJ7B3XmGFk82XYdQ/go-cid"
node
"gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format"
node
"gx/ipfs/Qmb3Hm9QDFmfYuET4pu7Kyg8JV78jFa1nvZx5vnCZsK4ck/go-ipld-format"
)
)
var
log
=
logging
.
Logger
(
"merkledag"
)
var
ErrNotFound
=
fmt
.
Errorf
(
"merkledag: not found"
)
var
ErrNotFound
=
fmt
.
Errorf
(
"merkledag: not found"
)
// DAGService is an IPFS Merkle DAG service.
// DAGService is an IPFS Merkle DAG service.
...
...
merkledag_test.go
View file @
2f6bea5f
...
@@ -209,12 +209,6 @@ func runBatchFetchTest(t *testing.T, read io.Reader) {
...
@@ -209,12 +209,6 @@ func runBatchFetchTest(t *testing.T, read io.Reader) {
}
}
}
}
func
assertCanGet
(
t
*
testing
.
T
,
ds
DAGService
,
n
node
.
Node
)
{
if
_
,
err
:=
ds
.
Get
(
context
.
Background
(),
n
.
Cid
());
err
!=
nil
{
t
.
Fatal
(
err
)
}
}
func
TestCantGet
(
t
*
testing
.
T
)
{
func
TestCantGet
(
t
*
testing
.
T
)
{
ds
:=
dstest
.
Mock
()
ds
:=
dstest
.
Mock
()
a
:=
NodeWithData
([]
byte
(
"A"
))
a
:=
NodeWithData
([]
byte
(
"A"
))
...
...
node.go
View file @
2f6bea5f
...
@@ -215,9 +215,8 @@ func (n *ProtoNode) SetData(d []byte) {
...
@@ -215,9 +215,8 @@ func (n *ProtoNode) SetData(d []byte) {
// that. If a link of the same name existed, it is removed.
// that. If a link of the same name existed, it is removed.
func
(
n
*
ProtoNode
)
UpdateNodeLink
(
name
string
,
that
*
ProtoNode
)
(
*
ProtoNode
,
error
)
{
func
(
n
*
ProtoNode
)
UpdateNodeLink
(
name
string
,
that
*
ProtoNode
)
(
*
ProtoNode
,
error
)
{
newnode
:=
n
.
Copy
()
.
(
*
ProtoNode
)
newnode
:=
n
.
Copy
()
.
(
*
ProtoNode
)
err
:=
newnode
.
RemoveNodeLink
(
name
)
_
=
newnode
.
RemoveNodeLink
(
name
)
// ignore error
err
=
nil
// ignore error
err
:=
newnode
.
AddNodeLink
(
name
,
that
)
err
=
newnode
.
AddNodeLink
(
name
,
that
)
return
newnode
,
err
return
newnode
,
err
}
}
...
...
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