util

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf added in v0.6.3

func Errorf(str string, args ...interface{}) error

Errorf is a variant of fmt.Errorf that returns an error being wrapped directly if it is one of a number of specific values, such as nil or io.EOF.

Types

type LimitedReader

type LimitedReader struct {
	R io.Reader
	N uint32
	E error
}

LimitedReader is a reimplementation of io.LimitedReader with two main differences:

* N is a uint32, allowing for larger sizes on 32-bit systems. * A custom error can be returned if N becomes zero.

func (*LimitedReader) Read

func (lr *LimitedReader) Read(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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