()
| 22 | var templateFuncs template.FuncMap |
| 23 | |
| 24 | func init() { |
| 25 | taskFuncs := template.FuncMap{ |
| 26 | "OS": goos, |
| 27 | "ARCH": goarch, |
| 28 | "numCPU": runtime.NumCPU, |
| 29 | "catLines": catLines, |
| 30 | "splitLines": splitLines, |
| 31 | "fromSlash": filepath.FromSlash, |
| 32 | "toSlash": filepath.ToSlash, |
| 33 | "exeExt": exeExt, |
| 34 | "shellQuote": shellQuote, |
| 35 | "splitArgs": splitArgs, |
| 36 | "IsSH": IsSH, // Deprecated |
| 37 | "joinPath": filepath.Join, |
| 38 | "joinEnv": joinEnv, |
| 39 | "joinUrl": joinUrl, |
| 40 | "relPath": filepath.Rel, |
| 41 | "absPath": filepath.Abs, |
| 42 | "merge": merge, |
| 43 | "spew": spew.Sdump, |
| 44 | "fromYaml": fromYaml, |
| 45 | "mustFromYaml": mustFromYaml, |
| 46 | "toYaml": toYaml, |
| 47 | "mustToYaml": mustToYaml, |
| 48 | "uuid": uuid.New, |
| 49 | "randIntN": rand.IntN, |
| 50 | } |
| 51 | |
| 52 | // aliases |
| 53 | taskFuncs["q"] = taskFuncs["shellQuote"] |
| 54 | |
| 55 | // Deprecated aliases for renamed functions. |
| 56 | taskFuncs["FromSlash"] = taskFuncs["fromSlash"] |
| 57 | taskFuncs["ToSlash"] = taskFuncs["toSlash"] |
| 58 | taskFuncs["ExeExt"] = taskFuncs["exeExt"] |
| 59 | |
| 60 | templateFuncs = template.FuncMap(sprig.TxtFuncMap()) |
| 61 | maps.Copy(templateFuncs, taskFuncs) |
| 62 | } |
| 63 | |
| 64 | func goos() string { |
| 65 | return runtime.GOOS |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…