bytes

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package bytes aids in manipulating byte slices and writing bytes and strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src []byte) []byte

Copy will return a new byte slice with a copy of 'src's contents

Types

type StringWriter

type StringWriter interface {
	Write([]byte) (int, error)
	WriteByte(byte) error
	WriteRune(r rune) (int, error)
	WriteString(s string) (int, error)
}

StringWriter defines an abstract set of functions used when writing strings. bytes.Buffer, bufio.Writer & strings.Builder all implement this interface.

Although these methods expose the standard Go writer semantics of returning errors, users of StringWriter generally do not check for errors. Constructors of this interface should arrange to detect errors externally if needed (e.g. by checking the result of Flush on a bufio.Writer).

Jump to

Keyboard shortcuts

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