util

package
v0.0.0-...-3976360 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyBytes = []byte{}

EmptyBytes is an byte slice with length 0, but not equal to nil.

View Source
var ZeroByteReader = NewByteReader(0)

ZeroByteReader is an byteReader that returns unlimited zero bytes.

os.Open("/dev/zero") returns a similar byteReader.

Functions

func CatchError

func CatchError(errp *error)

func DupBytes

func DupBytes(b []byte) []byte

DupBytes dups b.

func FirstError

func FirstError(err0, err1 error) error

FirstError returns first no nil error from given errors.

Types

type ByteReader

type ByteReader interface {
	io.Reader
	io.ByteReader
}

func NewByteReader

func NewByteReader(c byte) ByteReader

NewByteReader creates an ByteReader that returns unlimited bytes with value c.

Jump to

Keyboard shortcuts

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