Documentation ¶
Index ¶
- func AppendIfUnique(destination []string, value string) []string
- func AppendUnique(destination []string, source []string) []string
- func Contains(list []string, x string) bool
- func ContainsArg(cmd string, k string) bool
- func Die(err string, a ...interface{})
- func Difference(s []string, t []string) []string
- func Exit(exitCode int, err string, a ...interface{})
- func Expand(s string, mapping func(string) string) (res string)
- func Filter(predicate func(string) bool, lists ...[]string) (ret []string)
- func Find(a []string, x string) int
- func FlattenPath(s string) string
- func IsCompilableSource(s string) bool
- func IsExecutable(fname string) bool
- func IsHeader(s string) bool
- func IsNotCompilableSource(s string) bool
- func IsNotHeader(s string) bool
- func Join(lists ...[]string) string
- func ListsContain(x string, lists ...[]string) bool
- func MixedListToBobTargets(fileTargetList []string) []string
- func MixedListToFiles(fileTargetList []string) []string
- func NewStringSlice(lists ...[]string) []string
- func PrefixAll(list []string, prefix string) []string
- func PrefixDirs(paths []string, dir string) []string
- func Remove(a []string, x string) []string
- func Reversed(in []string) []string
- func SortedKeys(m map[string]string) []string
- func SortedKeysBoolMap(m map[string]bool) []string
- func SortedKeysByteSlice(m map[string][]byte) []string
- func SplitPath(path string) (components []string)
- func StripPrefixAll(list []string, prefix string) []string
- func StripUnusedArgs(args map[string]string, cmd string)
- func Trim(args []string) []string
- func Unique(list []string) (ret []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfUnique ¶
func AppendUnique ¶
func ContainsArg ¶
`cmd` is the command that will be executed Return true if it contains a reference to the argument expansion `arg`
func Difference ¶
return s after removing elements found in t
func Expand ¶
Expand function is similar to os.Expand, with one difference: curly braces around variable names are compulsory - this only replaces recognized variable references. In particular, '$' followed by a character other than '{' will not be affected by expansion. E.g. "$a" will remain "$a" after expansion.
func FlattenPath ¶
FlattenPath produces a filename containing no slashes from a path.
func IsCompilableSource ¶
IsCompilableSource checks if filename extension is a compiled one
func IsExecutable ¶
IsExecutable returns true if the given file exists and is executable
func IsNotCompilableSource ¶
IsNotCompilableSource checks if filename extension isn't a compiled one
func IsNotHeader ¶
Does the input string look like it is a source file?
func Join ¶
Join multiple lists of strings. This replaces appending multiple arrays together before calling strings.Join().
func ListsContain ¶
func MixedListToBobTargets ¶
func MixedListToFiles ¶
func NewStringSlice ¶
NewStringSlice initialises a new slice from the input lists, which are concatenated. The in-built append function modifies the slice buffer of the existing slice. This means that using append has side-effect on the first list. The purpose of this function is to avoid those side-effects.
func PrefixDirs ¶
Prefixes a directory to every file in a list The returned file paths are the shortest paths (../ removed)
func Reversed ¶
Return a reversed a string array. This ought to be able to be done generically for any array type by using interfaces, but we only need to handle strings for now
func SortedKeys ¶
func SortedKeysBoolMap ¶
func SortedKeysByteSlice ¶
func StripPrefixAll ¶
Removes prefix from every item in the list
func StripUnusedArgs ¶
cmd is the command that will be executed args contains potential argument that may occur in ${} This function will remove unused arguments from the map
Types ¶
This section is empty.