From a7b848804083978c13f8844664a97ef684b9c887 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 25 Sep 2018 12:33:51 -0700 Subject: [PATCH] use all procs --- main.go | 2 -- src/croc/croc.go | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 65a706ca..1188d9d9 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,6 @@ import ( "log" "os" "path/filepath" - "runtime" "time" humanize "github.com/dustin/go-humanize" @@ -23,7 +22,6 @@ var codePhrase string var cr *croc.Croc func main() { - runtime.GOMAXPROCS(runtime.NumCPU()) app := cli.NewApp() app.Name = "croc" if version == "" { diff --git a/src/croc/croc.go b/src/croc/croc.go index c25c2cb2..9f833465 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -1,6 +1,7 @@ package croc import ( + "runtime" "time" "github.com/schollz/croc/src/logger" @@ -10,6 +11,10 @@ import ( "github.com/schollz/croc/src/zipper" ) +func init() { + runtime.GOMAXPROCS(runtime.NumCPU()) +} + // Croc options type Croc struct { // Options for all