mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-21 23:43:46 +00:00
io: specify Bytes() behavior a bit better for BufBinWriter
It's not immediately obvious. Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
cee296eb92
commit
23f9c5a43b
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue