File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ var templateFuncs template.FuncMap
1717
1818func init () {
1919 taskFuncs := template.FuncMap {
20- "OS" : func () string { return runtime .GOOS },
21- "ARCH" : func () string { return runtime .GOARCH },
20+ "OS" : func () string { return runtime .GOOS },
21+ "ARCH" : func () string { return runtime .GOARCH },
22+ "numCPU" : func () int { return runtime .NumCPU () },
2223 "catLines" : func (s string ) string {
2324 s = strings .ReplaceAll (s , "\r \n " , " " )
2425 return strings .ReplaceAll (s , "\n " , " " )
Original file line number Diff line number Diff line change @@ -374,7 +374,8 @@ Lastly, Task itself provides a few functions:
374374| Function | Description |
375375| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
376376| `OS` | Returns the operating system. Possible values are `windows`, `linux`, `darwin` (macOS) and `freebsd`. |
377- | `ARCH` | return the architecture Task was compiled to : ` 386` , `amd64`, `arm` or `s390x`. |
377+ | `ARCH` | Returns the architecture Task was compiled to : ` 386` , `amd64`, `arm` or `s390x`. |
378+ | `numCPU` | Returns the number of logical CPU's usable by the current process. |
378379| `splitLines` | Splits Unix (`\n`) and Windows (`\r\n`) styled newlines. |
379380| `catLines` | Replaces Unix (`\n`) and Windows (`\r\n`) styled newlines with a space. |
380381| `toSlash` | Does nothing on Unix, but on Windows converts a string from `\` path format to `/`. |
You can’t perform that action at this time.
0 commit comments