Skip to content

Commit

Permalink
Fix BinaryWriter to append to the given slice
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed May 4, 2024
1 parent e059b41 commit 80d8980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 80d8980

Please sign in to comment.