From: YenForYang Date: Sat, 18 Sep 2021 02:36:25 +0000 (-0500) Subject: Prevent allocation when checking interface (#649) X-Git-Tag: v1.32.0~44 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f3a9ea5aa91d80b8ad202459a174ba126c2d2354;p=btrtrc.git Prevent allocation when checking interface (#649) --- diff --git a/bencode/bytes.go b/bencode/bytes.go index b196963b..5e1018e4 100644 --- a/bencode/bytes.go +++ b/bencode/bytes.go @@ -3,8 +3,8 @@ package bencode type Bytes []byte var ( - _ Unmarshaler = &Bytes{} - _ Marshaler = &Bytes{} + _ Unmarshaler = (*Bytes)(nil) + _ Marshaler = (*Bytes)(nil) _ Marshaler = Bytes{} )