properly satisfy writerTo interface

This commit is contained in:
Jeromy
2020-05-01 15:44:06 -07:00
parent 7d7cb88d78
commit 266e76d591

5
cid.go
View File

@@ -415,9 +415,8 @@ func (c Cid) ByteLen() int {
}
// WriteTo writes the cids bytes to the given writer
func (c Cid) WriteTo(w io.Writer) error {
_, err := io.WriteString(w, c.str)
return err
func (c Cid) WriteTo(w io.Writer) (int, error) {
return io.WriteString(w, c.str)
}
// MarshalBinary is equivalent to Bytes(). It implements the