ioutil

package
v0.82.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneKB uint64 = 1024
	OneMB        = 1024 * OneKB
	OneGB        = 1024 * OneMB
)

Variables

View Source
var ErrReadLimitExceeded = errors.New("read limit exceeded")

Functions

func ReadLimited

func ReadLimited(r io.Reader, limit uint64) ([]byte, error)

ReadLimited reads data from the provided reader up to the given limit. It returns ErrReadLimitExceeded if the data exceeds the specified limit. Under the hood, it reads a single extra byte to check if the limit is exceeded. If that is a concern for your use case, just use io.LimitReader directly.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL