diff --git a/common/automaxprocs/automaxprocs.go b/common/automaxprocs/automaxprocs.go deleted file mode 100644 index 293f4f6..0000000 --- a/common/automaxprocs/automaxprocs.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package automaxprocs automatically sets GOMAXPROCS to match the Linux -// container CPU quota, if any. -package automaxprocs - -import ( - "go.uber.org/automaxprocs/maxprocs" -) - -func init() { - maxprocs.Set(maxprocs.Logger(func(string, ...any) {})) -} diff --git a/main.go b/main.go index 637d903..0c80001 100644 --- a/main.go +++ b/main.go @@ -6,9 +6,10 @@ import ( "os/signal" "syscall" - _ "github.com/xjasonlyu/tun2socks/v2/common/automaxprocs" "github.com/xjasonlyu/tun2socks/v2/engine" "github.com/xjasonlyu/tun2socks/v2/log" + + "go.uber.org/automaxprocs/maxprocs" ) var key = new(engine.Key) @@ -29,6 +30,8 @@ func init() { } func main() { + maxprocs.Set(maxprocs.Logger(func(string, ...any) {})) + engine.Insert(key) checkErr := func(msg string, f func() error) {