From 266e76d5915c456a2999657a2d0c6b4299af6866 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 1 May 2020 15:44:06 -0700 Subject: [PATCH] properly satisfy writerTo interface --- cid.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cid.go b/cid.go index d078b9a..becf6e8 100644 --- a/cid.go +++ b/cid.go @@ -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 -- GitLab