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
ld
go-ld-prime
Commits
8c54f51a
Unverified
Commit
8c54f51a
authored
Aug 25, 2020
by
Eric Myhre
Committed by
GitHub
Aug 25, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68 from mvdan/unused-error
linking/cid: check a previously unused error
parents
30e4b351
2a5d5cf4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
codec/dagcbor/marshal.go
codec/dagcbor/marshal.go
+1
-1
codec/dagjson/marshal.go
codec/dagjson/marshal.go
+1
-1
linking/cid/cidLink.go
linking/cid/cidLink.go
+3
-0
No files found.
codec/dagcbor/marshal.go
View file @
8c54f51a
...
...
@@ -137,7 +137,7 @@ func marshal(n ipld.Node, tk *tok.Token, sink shared.TokenSink) error {
tk
.
Tagged
=
false
return
err
default
:
return
fmt
.
Errorf
(
"schemafree link emission only supported by this codec for CID type links
!
"
)
return
fmt
.
Errorf
(
"schemafree link emission only supported by this codec for CID type links"
)
}
default
:
panic
(
"unreachable"
)
...
...
codec/dagjson/marshal.go
View file @
8c54f51a
...
...
@@ -147,7 +147,7 @@ func Marshal(n ipld.Node, sink shared.TokenSink) error {
}
return
nil
default
:
return
fmt
.
Errorf
(
"schemafree link emission only supported by this codec for CID type links
!
"
)
return
fmt
.
Errorf
(
"schemafree link emission only supported by this codec for CID type links"
)
}
default
:
panic
(
"unreachable"
)
...
...
linking/cid/cidLink.go
View file @
8c54f51a
...
...
@@ -84,6 +84,9 @@ func (lb LinkBuilder) Build(ctx context.Context, lnkCtx ipld.LinkContext, node i
return
nil
,
err
}
cid
,
err
:=
lb
.
Prefix
.
Sum
(
hasher
.
Bytes
())
if
err
!=
nil
{
return
nil
,
err
}
lnk
:=
Link
{
cid
}
if
err
:=
commit
(
lnk
);
err
!=
nil
{
return
lnk
,
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