simple tabulation

This commit is contained in:
Laurent Ulrich 2024-11-15 15:35:13 +01:00
parent 7bf103427b
commit 62296e1da6
1 changed files with 5 additions and 5 deletions

View File

@ -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))
}