From 1fc094e0e0a05be67ecfafb432736fc2502cac8b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 22 Jun 2018 14:31:41 -0700 Subject: [PATCH] explicitly throw away impossible write errors --- codec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codec.go b/codec.go index 95a0f67..d95a0da 100644 --- a/codec.go +++ b/codec.go @@ -26,7 +26,7 @@ func stringToBytes(s string) ([]byte, error) { if p.Code == 0 { return nil, fmt.Errorf("no protocol with name %s", sp[0]) } - b.Write(CodeToVarint(p.Code)) + _, _ = b.Write(CodeToVarint(p.Code)) sp = sp[1:] if p.Size == 0 { // no length. @@ -51,7 +51,7 @@ func stringToBytes(s string) ([]byte, error) { return nil, fmt.Errorf("failed to parse %s: %s %s", p.Name, sp[0], err) } if p.Size < 0 { // varint size. - b.Write(CodeToVarint(len(a))) + _, _ = b.Write(CodeToVarint(len(a))) } b.Write(a) sp = sp[1:]