Go Notes

From Federal Burro of Information
Revision as of 20:17, 3 March 2021 by David (talk | contribs) (Created page with " == NumCPU() == How many cpu's does my pod see? tmp.go <pre> package main import "fmt" import "runtime" func main() { var i interface{} = runtime.NumCPU() fmt.Prin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

NumCPU()

How many cpu's does my pod see?

tmp.go

package main

import "fmt"
import "runtime"

func main() {
    var i interface{} = runtime.NumCPU()
    fmt.Printf("%v\n", i)
    fmt.Println("hello world")
}

go run tmp.go

16
hello world