fixed bug where empty line would crash program

This commit is contained in:
2025-08-13 09:14:42 -04:00
parent 2fa6aef836
commit 42ccf3c812

View File

@@ -71,6 +71,7 @@ func main() {
})) }))
for _, upc := range upcs { for _, upc := range upcs {
if len(upc) > 0 {
checkForNonStartingNumber := regex.MatchString(upc) checkForNonStartingNumber := regex.MatchString(upc)
if checkForNonStartingNumber { if checkForNonStartingNumber {
@@ -78,7 +79,7 @@ func main() {
continue continue
} }
if isNumeric(upc) == true { if isNumeric(upc) {
gtins = append(gtins, upc) gtins = append(gtins, upc)
continue continue
} }
@@ -111,6 +112,10 @@ func main() {
gtins = append(gtins, upc) gtins = append(gtins, upc)
checkBar.Add(1) checkBar.Add(1)
} else {
gtins = append(gtins, "")
checkBar.Add(1)
}
} }
answerBar := progressbar.NewOptions(len(gtins), answerBar := progressbar.NewOptions(len(gtins),