rename errorFlag to okFlag to make it even more clearer #22

This commit is contained in:
mattes 2014-12-19 12:10:32 -08:00
parent bcba31af11
commit 2cf4b2c33e
1 changed files with 5 additions and 5 deletions

10
main.go
View File

@ -155,14 +155,14 @@ func main() {
} }
} }
func writePipe(pipe chan interface{}) bool { func writePipe(pipe chan interface{}) (ok bool) {
errorFlag := false okFlag := true
if pipe != nil { if pipe != nil {
for { for {
select { select {
case item, ok := <-pipe: case item, ok := <-pipe:
if !ok { if !ok {
return !errorFlag return false
} else { } else {
switch item.(type) { switch item.(type) {
@ -172,7 +172,7 @@ func writePipe(pipe chan interface{}) bool {
case error: case error:
c := color.New(color.FgRed) c := color.New(color.FgRed)
c.Println(item.(error).Error(), "\n") c.Println(item.(error).Error(), "\n")
errorFlag = true okFlag = false
case file.File: case file.File:
f := item.(file.File) f := item.(file.File)
@ -192,7 +192,7 @@ func writePipe(pipe chan interface{}) bool {
} }
} }
} }
return errorFlag return okFlag
} }
func verifyMigrationsPath(path string) { func verifyMigrationsPath(path string) {