Commit 823a0716 authored by Łukasz Magiera's avatar Łukasz Magiera

fix error style

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent 6598da30
......@@ -21,7 +21,7 @@ import (
func (n *ProtoNode) unmarshal(encoded []byte) error {
var pbn pb.PBNode
if err := pbn.Unmarshal(encoded); err != nil {
return fmt.Errorf("Unmarshal failed. %v", err)
return fmt.Errorf("unmarshal failed. %v", err)
}
pbnl := pbn.GetLinks()
......@@ -30,7 +30,7 @@ func (n *ProtoNode) unmarshal(encoded []byte) error {
n.links[i] = &ipld.Link{Name: l.GetName(), Size: l.GetTsize()}
c, err := cid.Cast(l.GetHash())
if err != nil {
return fmt.Errorf("Link hash #%d is not valid multihash. %v", i, err)
return fmt.Errorf("link hash #%d is not valid multihash. %v", i, err)
}
n.links[i].Cid = c
}
......@@ -47,7 +47,7 @@ func (n *ProtoNode) Marshal() ([]byte, error) {
pbn := n.getPBNode()
data, err := pbn.Marshal()
if err != nil {
return data, fmt.Errorf("Marshal failed. %v", err)
return data, fmt.Errorf("marshal failed. %v", err)
}
return data, nil
}
......@@ -123,9 +123,9 @@ func DecodeProtobufBlock(b blocks.Block) (ipld.Node, error) {
decnd, err := DecodeProtobuf(b.RawData())
if err != nil {
if strings.Contains(err.Error(), "Unmarshal failed") {
return nil, fmt.Errorf("The block referred to by '%s' was not a valid merkledag node", c)
return nil, fmt.Errorf("the block referred to by '%s' was not a valid merkledag node", c)
}
return nil, fmt.Errorf("Failed to decode Protocol Buffers: %v", err)
return nil, fmt.Errorf("failed to decode Protocol Buffers: %v", err)
}
decnd.cached = c
......
......@@ -74,7 +74,7 @@ func (n *dagService) Get(ctx context.Context, c *cid.Cid) (ipld.Node, error) {
if err == bserv.ErrNotFound {
return nil, ipld.ErrNotFound
}
return nil, fmt.Errorf("Failed to get block for %s: %v", c, err)
return nil, fmt.Errorf("failed to get block for %s: %v", c, err)
}
return ipld.Decode(b)
......
......@@ -239,7 +239,7 @@ func runBatchFetchTest(t *testing.T, read io.Reader) {
}
if !bytes.Equal(datagot, expected) {
errs <- errors.New("Got bad data back!")
errs <- errors.New("got bad data back")
}
}(i)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment