Skip to content

Commit

Permalink
Merge pull request #47 from ipfs/change-write-to-signature
Browse files Browse the repository at this point in the history
change WriteTo to the standard signature
  • Loading branch information
marten-seemann authored May 19, 2021
2 parents cbe2a92 + 440c47c commit 35a268a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,18 @@ func (t *Tree) Stat() (*node.NodeStat, error) {
return &node.NodeStat{}, nil
}

func (te *TreeEntry) WriteTo(w io.Writer) (int, error) {
func (te *TreeEntry) WriteTo(w io.Writer) (int64, error) {
n, err := fmt.Fprintf(w, "%s %s\x00", te.Mode, te.name)
if err != nil {
return 0, err
}

nn, err := w.Write(cidToSha(te.Hash))
if err != nil {
return n, err
return int64(n), err
}

return n + nn, nil
return int64(n + nn), nil
}

var _ node.Node = (*Tree)(nil)

0 comments on commit 35a268a

Please sign in to comment.