Documentation
¶
Overview ¶
Package fileinput provides utility functions for handling files named on the command line.
Index ¶
- func Cat(ctx context.Context, paths []string) io.ReadCloser
- func CatOrFile(ctx context.Context, paths []string, f io.ReadCloser) io.ReadCloser
- func Each(ctx context.Context, paths []string, rf ReadFunc) error
- func EachOrStdin(ctx context.Context, paths []string, rf ReadFunc) error
- type Opener
- type ReadFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cat ¶
func Cat(ctx context.Context, paths []string) io.ReadCloser
Cat returns an io.ReadCloser that delivers the logical concatenation of the specified input files. The files are read sequentially, and any non-nil, non-EOF error from one of the underlying files is returned. If no files are specified, the resulting reader is empty.
func CatOrFile ¶
func CatOrFile(ctx context.Context, paths []string, f io.ReadCloser) io.ReadCloser
CatOrFile acts as Cat, but if no paths are specified it returns f.
Types ¶
Click to show internal directories.
Click to hide internal directories.