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-dms3
Commits
3a0bbe2a
Commit
3a0bbe2a
authored
Oct 28, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #224 from jbenet/issue-209-plus
refactor(blockservice, merkledag, namesys) deprecate u.ErrNotFound
parents
cee1e9cc
9a9dc926
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
blockservice/blockservice.go
blockservice/blockservice.go
+3
-1
merkledag/merkledag.go
merkledag/merkledag.go
+2
-1
namesys/dns.go
namesys/dns.go
+1
-3
No files found.
blockservice/blockservice.go
View file @
3a0bbe2a
package
blockservice
import
(
"errors"
"fmt"
context
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
...
...
@@ -13,6 +14,7 @@ import (
)
var
log
=
u
.
Logger
(
"blockservice"
)
var
ErrNotFound
=
errors
.
New
(
"blockservice: key not found"
)
// BlockService is a block datastore.
// It uses an internal `datastore.Datastore` instance to store values.
...
...
@@ -73,7 +75,7 @@ func (s *BlockService) GetBlock(ctx context.Context, k u.Key) (*blocks.Block, er
return
blk
,
nil
}
else
{
log
.
Debug
(
"Blockservice GetBlock: Not found."
)
return
nil
,
u
.
ErrNotFound
return
nil
,
ErrNotFound
}
}
...
...
merkledag/merkledag.go
View file @
3a0bbe2a
...
...
@@ -13,6 +13,7 @@ import (
)
var
log
=
u
.
Logger
(
"merkledag"
)
var
ErrNotFound
=
fmt
.
Errorf
(
"merkledag: not found"
)
// NodeMap maps u.Keys to Nodes.
// We cannot use []byte/Multihash for keys :(
...
...
@@ -103,7 +104,7 @@ func (n *Node) RemoveNodeLink(name string) error {
return
nil
}
}
return
u
.
ErrNotFound
return
ErrNotFound
}
// Copy returns a copy of the node.
...
...
namesys/dns.go
View file @
3a0bbe2a
...
...
@@ -6,8 +6,6 @@ import (
b58
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-base58"
isd
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-is-domain"
mh
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multihash"
u
"github.com/jbenet/go-ipfs/util"
)
// DNSResolver implements a Resolver on DNS domains
...
...
@@ -44,5 +42,5 @@ func (r *DNSResolver) Resolve(name string) (string, error) {
return
t
,
nil
}
return
""
,
u
.
Err
NotFoun
d
return
""
,
Err
ResolveFaile
d
}
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