files

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 5 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrExpectedStdin indicates that an stdin pipe was expected but not present
	ErrExpectedStdin = errors.New("expected a pipe stdin")
)

Functions

func CheckNotEmptyAndExists

func CheckNotEmptyAndExists(file string) error

CheckNotEmptyAndExists returns an error if the given file does not exist exists or is empty

func Pwd

func Pwd() (string, error)

Pwd returns the process working directory

func ReadInput

func ReadInput(inputPath string) ([]byte, error)

ReadInput reads bytes from inputPath (if not empty) or stdin

func ToAbsPath

func ToAbsPath(path, root string) (string, error)

ToAbsPath turns a relative path into an absolute path with the given root path, absolute paths are ignored

func WriteOutput

func WriteOutput(outputPath string, outputContent []byte, perm os.FileMode) error

WriteOutput writes given bytes into outputPath (if not empty) or stdout

Types

This section is empty.

Jump to

Keyboard shortcuts

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