1
0
mirror of https://github.com/go-task/task.git synced 2025-11-29 22:48:03 +02:00

feat: add numCPU func (#1890)

This commit is contained in:
Amogh Rameshappa Devapura
2024-10-29 09:50:17 -04:00
committed by GitHub
parent 7bfddaa25a
commit c381923d3e
2 changed files with 5 additions and 3 deletions

View File

@@ -17,8 +17,9 @@ var templateFuncs template.FuncMap
func init() {
taskFuncs := template.FuncMap{
"OS": func() string { return runtime.GOOS },
"ARCH": func() string { return runtime.GOARCH },
"OS": func() string { return runtime.GOOS },
"ARCH": func() string { return runtime.GOARCH },
"numCPU": func() int { return runtime.NumCPU() },
"catLines": func(s string) string {
s = strings.ReplaceAll(s, "\r\n", " ")
return strings.ReplaceAll(s, "\n", " ")