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
7e655ddf
Commit
7e655ddf
authored
Feb 26, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more understandable errors from merkledag decoding
parent
c0fdcddd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
coding.go
coding.go
+5
-2
No files found.
coding.go
View file @
7e655ddf
...
...
@@ -92,7 +92,10 @@ func (n *Node) Encoded(force bool) ([]byte, error) {
// Decoded decodes raw data and returns a new Node instance.
func
Decoded
(
encoded
[]
byte
)
(
*
Node
,
error
)
{
n
:=
&
Node
{}
n
:=
new
(
Node
)
err
:=
n
.
Unmarshal
(
encoded
)
return
n
,
err
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"incorrectly formatted merkledag node: %s"
,
err
)
}
return
n
,
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