Documentation ¶
Overview ¶
Package util provides various utility functions. It also defines the following flags: --verbose, --debug, --silent, and --version
Index ¶
- Variables
- func CheckPath(path string)
- func Debug(s string)
- func DecreaseIndent()
- func Exists(path string) (res bool)
- func GetPath(p string) (path string)
- func IncreaseIndent()
- func Mock(w io.Writer)
- func Parse()
- func Print(s string)
- func PrintDep(name string, d dep.Dependency)
- func PrintIndent(s string)
- func Pwd() (pwd string)
- func SetVerbose(v bool)
- func UpwardFind(dir string, file string) (found string)
- func Verbose(s string)
- func VerboseIndent(s string)
- func Version(v string)
Constants ¶
This section is empty.
Variables ¶
var ( Fatal func(v ...interface{}) RunCommand = defaultRun OsExit = os.Exit Cd = defaultCd )
Polymorphics to allow mocking in tests, these should always be set to their defaults except during testing
var ( // OutputTarget is an io.Writer to write messages to, change it to a bytes.buffer to test output OutputTarget = os.Stderr )
Functions ¶
func CheckPath ¶
func CheckPath(path string)
CheckPath causes the application to exit if path does not exist
func DecreaseIndent ¶
func DecreaseIndent()
DecreaseIndent decrements the indentation level used during PrintIndent calls
func IncreaseIndent ¶
func IncreaseIndent()
IncreaseIndent Increments the indentation level used during PrintIndent calls
func PrintDep ¶
func PrintDep(name string, d dep.Dependency)
PrintDep displays a dependency based on the --silent and --verbose flags
func PrintIndent ¶
func PrintIndent(s string)
PrintIndent prints s with indentation unless --silent is set
func UpwardFind ¶
UpwardFind searches for file starting in dir and moving up the path. Returns the path to the found file or the empty string if it was not found
func VerboseIndent ¶
func VerboseIndent(s string)
VerboseIndent prints s with indentation if --verbose is set
Types ¶
This section is empty.