fixed bug where empty line would crash program
This commit is contained in:
7
main.go
7
main.go
@@ -71,6 +71,7 @@ func main() {
|
||||
}))
|
||||
|
||||
for _, upc := range upcs {
|
||||
if len(upc) > 0 {
|
||||
checkForNonStartingNumber := regex.MatchString(upc)
|
||||
|
||||
if checkForNonStartingNumber {
|
||||
@@ -78,7 +79,7 @@ func main() {
|
||||
continue
|
||||
}
|
||||
|
||||
if isNumeric(upc) == true {
|
||||
if isNumeric(upc) {
|
||||
gtins = append(gtins, upc)
|
||||
continue
|
||||
}
|
||||
@@ -111,6 +112,10 @@ func main() {
|
||||
|
||||
gtins = append(gtins, upc)
|
||||
checkBar.Add(1)
|
||||
} else {
|
||||
gtins = append(gtins, "")
|
||||
checkBar.Add(1)
|
||||
}
|
||||
}
|
||||
|
||||
answerBar := progressbar.NewOptions(len(gtins),
|
||||
|
Reference in New Issue
Block a user