Skip to content

Commit

Permalink
Merge pull request #3663 from nspcc-dev/io-improve-bytes-doc
Browse files Browse the repository at this point in the history
io: specify Bytes() behavior a bit better for BufBinWriter
  • Loading branch information
AnnaShaleva authored Nov 6, 2024
2 parents 8c4d943 + 23f9c5a commit 1a540d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/io/binaryBufWriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func (bw *BufBinWriter) Len() int {
}

// Bytes returns the resulting buffer and makes future writes return an error.
// Subsequent calls to it will return nil. You can reuse this instance of
// [BufBinWriter] after [BufBinWriter.Reset].
func (bw *BufBinWriter) Bytes() []byte {
if bw.Err != nil {
return nil
Expand Down

0 comments on commit 1a540d5

Please sign in to comment.