From 80d8980f2e49cfad892fda39a5890f93e553765d Mon Sep 17 00:00:00 2001 From: Taco de Wolff Date: Sat, 4 May 2024 16:22:55 -0400 Subject: [PATCH] Fix BinaryWriter to append to the given slice --- binary.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binary.go b/binary.go index 0193320..ebce520 100644 --- a/binary.go +++ b/binary.go @@ -164,7 +164,7 @@ type BinaryWriter struct { // NewBinaryWriter returns a big endian binary file format writer. func NewBinaryWriter(buf []byte) *BinaryWriter { - return &BinaryWriter{buf[:0]} + return &BinaryWriter{buf} } // Len returns the buffer's length in bytes.