From c0bdba0276fc93fd9a2856bf7f9784b3e06e1f0a Mon Sep 17 00:00:00 2001 From: Arran Schlosberg Date: Fri, 1 Mar 2024 18:48:56 +0000 Subject: [PATCH] fix: placate the linter --- compile.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compile.go b/compile.go index 1dcdf6f..aaf95e4 100644 --- a/compile.go +++ b/compile.go @@ -275,7 +275,11 @@ func (s *spliceConcat) shrink() error { func (s *spliceConcat) bytes() ([]byte, error) { code := new(bytes.Buffer) for _, sp := range s.all { - sp.buf.WriteTo(code) + if _, err := sp.buf.WriteTo(code); err != nil { + // This should be impossible, but ignoring the error angers the + // linter. + return nil, fmt.Errorf("%T.bytes(): %T.buf.WriteTo(%T): %v", s, sp, code, err) + } switch sp.op.(type) { case JUMPDEST: