mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
19 lines
441 B
Go
19 lines
441 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
|
|
"go.uber.org/automaxprocs/maxprocs"
|
|
)
|
|
|
|
func main() {
|
|
// Set maxprocs with a custom logger that does nothing to ignore logs.
|
|
maxprocs.Set(maxprocs.Logger(func(string, ...interface{}) {
|
|
// Intentionally left blank to suppress all log output from automaxprocs.
|
|
}))
|
|
|
|
// Now this will print the GOMAXPROCS value without printing the automaxprocs log message.
|
|
fmt.Println(runtime.GOMAXPROCS(0))
|
|
}
|