Skip to content

Commit 823a071

Browse files
committed
fix error style
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
1 parent 6598da3 commit 823a071

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

coding.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
func (n *ProtoNode) unmarshal(encoded []byte) error {
2222
var pbn pb.PBNode
2323
if err := pbn.Unmarshal(encoded); err != nil {
24-
return fmt.Errorf("Unmarshal failed. %v", err)
24+
return fmt.Errorf("unmarshal failed. %v", err)
2525
}
2626

2727
pbnl := pbn.GetLinks()
@@ -30,7 +30,7 @@ func (n *ProtoNode) unmarshal(encoded []byte) error {
3030
n.links[i] = &ipld.Link{Name: l.GetName(), Size: l.GetTsize()}
3131
c, err := cid.Cast(l.GetHash())
3232
if err != nil {
33-
return fmt.Errorf("Link hash #%d is not valid multihash. %v", i, err)
33+
return fmt.Errorf("link hash #%d is not valid multihash. %v", i, err)
3434
}
3535
n.links[i].Cid = c
3636
}
@@ -47,7 +47,7 @@ func (n *ProtoNode) Marshal() ([]byte, error) {
4747
pbn := n.getPBNode()
4848
data, err := pbn.Marshal()
4949
if err != nil {
50-
return data, fmt.Errorf("Marshal failed. %v", err)
50+
return data, fmt.Errorf("marshal failed. %v", err)
5151
}
5252
return data, nil
5353
}
@@ -123,9 +123,9 @@ func DecodeProtobufBlock(b blocks.Block) (ipld.Node, error) {
123123
decnd, err := DecodeProtobuf(b.RawData())
124124
if err != nil {
125125
if strings.Contains(err.Error(), "Unmarshal failed") {
126-
return nil, fmt.Errorf("The block referred to by '%s' was not a valid merkledag node", c)
126+
return nil, fmt.Errorf("the block referred to by '%s' was not a valid merkledag node", c)
127127
}
128-
return nil, fmt.Errorf("Failed to decode Protocol Buffers: %v", err)
128+
return nil, fmt.Errorf("failed to decode Protocol Buffers: %v", err)
129129
}
130130

131131
decnd.cached = c

merkledag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (n *dagService) Get(ctx context.Context, c *cid.Cid) (ipld.Node, error) {
7474
if err == bserv.ErrNotFound {
7575
return nil, ipld.ErrNotFound
7676
}
77-
return nil, fmt.Errorf("Failed to get block for %s: %v", c, err)
77+
return nil, fmt.Errorf("failed to get block for %s: %v", c, err)
7878
}
7979

8080
return ipld.Decode(b)

merkledag_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func runBatchFetchTest(t *testing.T, read io.Reader) {
239239
}
240240

241241
if !bytes.Equal(datagot, expected) {
242-
errs <- errors.New("Got bad data back!")
242+
errs <- errors.New("got bad data back")
243243
}
244244
}(i)
245245
}

0 commit comments

Comments
 (0)