extra fields ok
parent
5463c2d05a
commit
7f8ad39656
6
main.go
6
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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue