transform

package
v0.0.0-...-522e6a3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2016 License: ISC Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transform

func Transform(data []byte, fn RemoveFunc) (result []byte, n int, err error)

Transform removes from the input all carriage returns and replaces multiple whitespaces with one. Illegal bytes in the input are replaced by utf8.RuneError. Not doing so might otherwise turn a sequence of invalid UTF-8 into valid UTF-8. The resulting byte sequence may subsequently contain runes for which t(r) is true that were passed unnoticed.

If fn is not nil Transform removes from the input data all runes r for which fn(r) is true.

Types

type RemoveFunc

type RemoveFunc func(r rune) bool

Jump to

Keyboard shortcuts

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