From 62296e1da602068edf41b2ca7ca22e2f9878e540 Mon Sep 17 00:00:00 2001 From: Laurent Ulrich Date: Fri, 15 Nov 2024 15:35:13 +0100 Subject: [PATCH] simple tabulation --- csvparser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/csvparser.go b/csvparser.go index 89c54f5..74a2ea6 100644 --- a/csvparser.go +++ b/csvparser.go @@ -107,12 +107,12 @@ func (p *CsvParser) Parse(line string) (map[string]string, error) { // current rune is a delimiter, a value is present and the next char is the next value if isDelimiter || index == maxIndex { - if index == maxIndex && valueStart == -1 { - valueStart = 0 - } + if index == maxIndex && valueStart == -1 { + valueStart = 0 + } state.delimiter = true - field := line[valueStart:index +1] - field = strings.TrimRight(field,p.delimiters) + field := line[valueStart : index+1] + field = strings.TrimRight(field, p.delimiters) if state.enclosed { field = strings.TrimRight(strings.TrimLeft(field, string(state.encloserStart)), string(state.encloserEnd)) }