Documentation ¶
Index ¶
- func AppendError(errs []error, err error) []error
- func AppendField(fields []string, flag, prefix string) []string
- func EnsureExecutable(p string) error
- func ExecError(err error) string
- func ExtractField(fields []string, target string) ([]string, string, bool)
- func FlushMem()
- func Home(parts ...string) string
- func InsertPath(path string) error
- func JoinURL(urlPath, path string) (string, error)
- func JsonForDebug(o interface{}) string
- func K8s(topdir string, parts ...string) string
- func MigrateOptions(m []MigratedOption) error
- func PushEnv(env, value string) (func() error, error)
- func Pushd(dir string) (func() error, error)
- func SetFieldDefault(fields []string, flag, val string) []string
- type MigratedOption
- type TestCase
- type TestSuite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendError ¶
append(errs, err) if err != nil
func AppendField ¶
func EnsureExecutable ¶
EnsureExecutable sets the executable file mode bits, for all users, to ensure that we can execute a file
func ExecError ¶
ExecError returns a string format of err including stderr if the err is an ExitError, useful for errors from e.g. exec.Cmd.Output().
func ExtractField ¶
ExtractField("--a=this --b=that --c=other", "--b") returns [--a=this, --c=other"], "that"
func FlushMem ¶
func FlushMem()
FlushMem will try to reduce the memory usage of the container it is running in run this after a build
func JsonForDebug ¶
func JsonForDebug(o interface{}) string
JsonForDebug returns a json representation of the value, or a string representation of an error It is useful for an easy implementation of fmt.Stringer
func MigrateOptions ¶
func MigrateOptions(m []MigratedOption) error
Read value from ENV if --flag unset, optionally pushing to ENV
func SetFieldDefault ¶
Types ¶
type MigratedOption ¶
type MigratedOption struct { Env string // env associated with --flag Option *string // Value of --flag Name string // --flag name SkipPush bool // Push option to env if false }
Option that was an ENV that is now a --flag