Documentation
¶
Overview ¶
Package limitbuf provides a sticky-error string builder with a hard byte limit. It is useful in renderers whose WriteString errors are intentionally ignored at individual call sites.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooLarge = errors.New("buffer exceeds size limit")
ErrTooLarge reports that a write would exceed a Buffer's byte limit.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer accumulates text up to limit bytes. A non-positive limit is unlimited. Once a write would exceed the limit, all later writes return the same sticky error and no partial write is retained.
Click to show internal directories.
Click to hide internal directories.