diff --git a/examples/go/demo.go b/examples/go/demo.go index 0042b082d08c2e7e39dc112caa0c7ffa681ae72b..2aa738f1540faa241eed0d3f06e55aaa71736eee 100644 --- a/examples/go/demo.go +++ b/examples/go/demo.go @@ -7,6 +7,7 @@ import ( "flag" "fmt" "reflect" + "runtime" "strconv" "strings" "sync" @@ -554,6 +555,11 @@ func printAllArgs() { func main() { printAllArgs() + + cpuNum := runtime.NumCPU() + fmt.Println("cpu核心数:", cpuNum) + runtime.GOMAXPROCS(cpuNum) + url = "root:taosdata@/tcp(" + configPara.hostName + ":" + strconv.Itoa(configPara.serverPort) + ")/" db, err := sql.Open(taosDriverName, url)