cmdyutil

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStdinOrFileError

func IsStdinOrFileError(err error) bool

func OpenStdinOrFile

func OpenStdinOrFile(ctx cmdy.Context, fileName string) (rdr io.ReadCloser, err error)

OpenStdinOrFile will check if the program's input is a pipe. If so, it will return stdin, otherwise it will return an open file.

The returned ReadCloser must always be closed.

func ReadStdinOrFile

func ReadStdinOrFile(ctx cmdy.Context, fileName string) (bts []byte, err error)

ReadStdinOrFile will check if the program's input is a pipe. If so, it will read from stdin, otherwise it will read from fileName.

Types

This section is empty.

Jump to

Keyboard shortcuts

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