From 18289e3c316915fcfa3e03449fd224289bde0a65 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Thu, 17 Dec 2015 18:09:45 +0900 Subject: [PATCH] Setting target file count to # of CPU --- types.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types.go b/types.go index e58f4b2..ffb02bd 100644 --- a/types.go +++ b/types.go @@ -22,9 +22,10 @@ package goldsmith -import "bytes" - -const TargetFileCount = 32 +import ( + "bytes" + "runtime" +) type Goldsmith interface { Chain(p Plugin) Goldsmith @@ -32,7 +33,7 @@ type Goldsmith interface { } func New(srcDir, dstDir string) Goldsmith { - return NewThrottled(srcDir, dstDir, TargetFileCount) + return NewThrottled(srcDir, dstDir, uint(runtime.NumCPU())) } func NewThrottled(srcDir, dstDir string, targetFileCount uint) Goldsmith {