From 7f8ad39656b174b05d664e8cf0ec620eca16889a Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Sun, 23 Feb 2025 16:53:48 -0700 Subject: [PATCH] extra fields ok --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f13b398..e0f039e 100644 --- a/main.go +++ b/main.go @@ -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") }