lwcutil

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const EndOfFiles string = ""

EndOfFiles marks the end of the list of files

Variables

View Source
var LastError interface{}

LastError is the last error produced during tests

Functions

func Fatal

func Fatal(err interface{})

Fatal logs a fatal error to the environment's UI

func FlushStdoutBuffer

func FlushStdoutBuffer() []byte

FlushStdoutBuffer flushes stdout for the environment's UI and returns its contents

func GetPipeReaders

func GetPipeReaders(pipes []Pipe) []*io.PipeReader

GetPipeReaders maps pipes to their readers

func GetPipeWriters

func GetPipeWriters(pipes []Pipe) []*io.PipeWriter

GetPipeWriters maps pipes to their writers

func GetStdout

func GetStdout() io.Writer

GetStdout returns the writer that represents stdout in the environment's UI

func MultiPipe

func MultiPipe(reader io.Reader, pws []*io.PipeWriter)

MultiPipe copies a reader to multiple PipeWriters

func NewFilesChanFromReader added in v0.4.0

func NewFilesChanFromReader(reader io.Reader, separator byte) *chan string

NewFilesChanFromReader creates a files chan from a reader, one name per line

func NewFilesChanFromSlice added in v0.4.0

func NewFilesChanFromSlice(values []string) *chan string

NewFilesChanFromSlice creates a files chan from a string slice

func OpenFile

func OpenFile(name string) *os.File

OpenFile opens a file by name, or stdin if the name is a hyphen

func ScanBytes added in v0.4.4

func ScanBytes(b byte, requireEnd bool) bufio.SplitFunc

ScanBytes creates a SplitFunc that splits on the given byte value

func ScanLines added in v0.4.4

func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanLines scans by line, accepting \r, \n, or \r\n as the separator

func StdoutIsTTY added in v0.4.0

func StdoutIsTTY() bool

StdoutIsTTY returns true if stdout is a terminal, false otherwise

func ValidateFileName added in v0.4.0

func ValidateFileName(name string)

ValidateFileName checks whether the given string is a valid file name

Types

type Pipe

type Pipe struct {
	R *io.PipeReader
	W *io.PipeWriter
}

Pipe groups a PipeReader and a PipeWriter

func NewPipe

func NewPipe() Pipe

NewPipe creates a Pipe

Jump to

Keyboard shortcuts

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