Files
go_goutils/encodingx/binarystr/funcs_badreaderr.go
T
brent saner 7ec35990a9 v1.17.6
ADDED:
* mapsx.(ListSortedKeys|ListSortedValues|SortedKeys|SortedValues)
2026-10-10 01:32:35 -04:00

17 lines
437 B
Go

package binarystr
import (
`fmt`
)
// Error conforms a [BadReadErr] to an [error].
func (b *BadReadErr) Error() (err string) {
err = fmt.Sprintf("only read %d bytes from internal read source before encountering a read error", b.numBytes)
return
}
// NumBytesRead returns the number of bytes read (BEFORE mutation/encoding/decoding) before the error was hit.
func (b *BadReadErr) NumBytesRead() (u64 uint64) { return b.numBytes }