This commit is contained in:
Meutel 2017-07-08 16:50:08 +02:00
parent db3d0426ee
commit 78d5ca23a3

View File

@ -29,8 +29,7 @@ func main() {
for i := 0; i < 100; i++ {
go func() {
for {
path := <-chan_path
for path := range chan_path {
if h, err := sha256File(path); err != nil {
wg.Done()
log.Print("Error "+path, err)
@ -42,14 +41,14 @@ func main() {
}
go func() {
for {
fmt.Println(<-chan_hash)
for h := range chan_hash {
fmt.Println(h)
wg.Done()
}
}()
err := filepath.Walk(os.Args[1], func(path string, info os.FileInfo, err error) error {
if err != nil && !info.IsDir() {
if err == nil && !info.IsDir() {
wg.Add(1)
chan_path <- path
}