extra fields ok

main
Bel LaPointe 2025-02-23 16:53:48 -07:00
parent 5463c2d05a
commit 7f8ad39656
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import (
"log"
"os"
"strconv"
"strings"
)
func main() {
@ -23,9 +24,12 @@ func main() {
if err == io.EOF {
break
}
if err != nil {
if err != nil && !strings.Contains(err.Error(), "wrong number of fields") {
panic(err)
}
for len(line) < len(fields) {
line = append(line, "null")
}
if len(line) != len(fields) {
log.Println("[WARN]", "line", n, "has", len(line), "fields but only", len(fields), "are known")
}