util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneBytes

func CloneBytes(p []byte) []byte

CloneBytes creates a copy of the given byte slice.

func EscapeNewlines

func EscapeNewlines(s string) string

EscapeNewlines escapes the '\n' and '\r' characters with a backslash.

func IsNewlineChar

func IsNewlineChar(b byte) bool

IsNewlineChar returns whether the given character is '\n' or '\r'.

func RemovePrefix

func RemovePrefix(r io.Reader, prefix string) io.Reader

RemovePrefix returns a reader that removes the given prefix from the input. If you want to remove a long prefix make sure you read using a buffer sized equally to or greater than the prefix, otherwise an allocation will be made. The function returns the given reader if the prefix is an empty string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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