Browse Source

added ngo flag and default worker value (NumCpu)

pull/4/head
Derek McQuay 4 years ago
parent
commit
b11c4701c3
No known key found for this signature in database GPG Key ID: 92A7BC0C86B0B91A
2 changed files with 3 additions and 2 deletions
  1. +1
    -2
      check.go
  2. +2
    -0
      main.go

+ 1
- 2
check.go View File

@ -94,8 +94,7 @@ func check(files []string) chan error {
results := []<-chan error{}
workers := 32
for w := 0; w < workers; w++ {
for w := 0; w < *ngo; w++ {
results = append(results, compute(jobs))
}

+ 2
- 0
main.go View File

@ -9,10 +9,12 @@ import (
"fmt"
"io"
"os"
"runtime"
)
var algo = flag.String("a", "sha1", "algorithm to use")
var mode = flag.Bool("c", false, "check")
var ngo = flag.Int("n", runtime.NumCPU(), "number of goroutines")
func main() {
flag.Parse()

Loading…
Cancel
Save