dm/cs
1
0
forked from sm/cs

minor: rename error counter

This commit is contained in:
Stephen McQuay 2016-11-16 01:17:41 -08:00
parent 802792d620
commit 6705a3d27c
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D

12
main.go
View File

@ -23,25 +23,25 @@ func main() {
files := flag.Args() files := flag.Args()
switch *mode { switch *mode {
case true: case true:
c := 0 ec := 0
for err := range check(files) { for err := range check(files) {
c++ ec++
fmt.Fprintf(os.Stderr, "%v\n", err) fmt.Fprintf(os.Stderr, "%v\n", err)
} }
if c > 0 { if ec > 0 {
os.Exit(1) os.Exit(1)
} }
case false: case false:
c := 0 ec := 0
for res := range hsh(files) { for res := range hsh(files) {
if res.err != nil { if res.err != nil {
c++ ec++
fmt.Fprintf(os.Stderr, "%v\n", res.err) fmt.Fprintf(os.Stderr, "%v\n", res.err)
} else { } else {
fmt.Printf("%v\n", res.msg) fmt.Printf("%v\n", res.msg)
} }
} }
if c > 0 { if ec > 0 {
os.Exit(1) os.Exit(1)
} }
} }