Documentation ¶
Index ¶
- func CloseAll(closers ...io.Closer) error
- func DirEmpty(path string) bool
- func DirExists(path string) bool
- func ExitCode(err error) int
- func FileExists(path string) bool
- func ForEachLine(path string, fn func(line string) bool) error
- func ForEachReaderLine(r io.Reader, fn func(line string) bool) error
- func GenericGet(m map[string]interface{}, path string) interface{}
- func GenericSet(mp *map[string]interface{}, path string, value interface{})
- func Git(arg ...string) (string, error)
- func Must(err error)
- func MustReadJSONFile(filename string) *jnode.Node
- func PropagateCloseError(closer io.Closer, f func() error) (err error)
- func ReadJSONFile(filename string) (*jnode.Node, error)
- func RemoveJNodeElementsIf(n *jnode.Node, f func(*jnode.Node) bool) *jnode.Node
- func RemoveJNodeEntriesIf(n *jnode.Node, f func(key string, value *jnode.Node) bool) *jnode.Node
- func Size(n uint64) string
- func StringSliceContains(s []string, t string) bool
- func TempFile(pattern string) (string, error)
- func TruncateRight(s string, m int) string
- type Cache
- type StringSet
- func (ss *StringSet) Add(s string) bool
- func (ss *StringSet) AddAll(values ...string) *StringSet
- func (ss *StringSet) Contains(s string) bool
- func (ss *StringSet) Get(i int) string
- func (ss *StringSet) Len() int
- func (ss *StringSet) MarshalJSON() ([]byte, error)
- func (ss *StringSet) Reset()
- func (ss *StringSet) Values() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseAll ¶ added in v0.4.21
CloseAll calls Close() on every closer, returning the err from the first one that returns a non-nil error.
func ExitCode ¶ added in v0.4.31
Returns the exit code from an error if the error is an exec.ExitError, or -1 if the err is non-nil, or 0 otherwise.
func FileExists ¶ added in v0.4.56
func ForEachReaderLine ¶ added in v0.5.9
func GenericGet ¶ added in v0.5.7
func GenericSet ¶ added in v0.5.7
func MustReadJSONFile ¶ added in v0.4.38
func MustReadJSONFile(filename string) *jnode.Node
func PropagateCloseError ¶ added in v0.4.21
PropagateCloseError calls f then calls closer.Close(), returning the error from Close() if f did not return an error. Errors from Close() when writing can return important errors that should not be thrown away.
func ReadJSONFile ¶ added in v0.4.36
func RemoveJNodeElementsIf ¶ added in v0.4.34
func RemoveJNodeElementsIf(n *jnode.Node, f func(*jnode.Node) bool) *jnode.Node
func RemoveJNodeEntriesIf ¶ added in v0.4.38
func StringSliceContains ¶
func TruncateRight ¶ added in v0.4.36
Replaces newlines in s with spaces and truncates with "..." if the len(s) is more than m. The resulting string will always be m characters or less.
Types ¶
type Cache ¶ added in v0.4.39
type Cache struct {
// contains filtered or unexported fields
}
A simple-minded not-scalable LFU cache.
type StringSet ¶ added in v0.4.7
type StringSet struct {
// contains filtered or unexported fields
}
func NewStringSet ¶ added in v0.4.7
func NewStringSet() *StringSet
func NewStringSetWithValues ¶ added in v0.4.15
func (*StringSet) Add ¶ added in v0.4.7
Adds s to the set and returns true if the string wasn't already present