mirror of
https://github.com/golang/go
synced 2024-11-24 08:20:03 -07:00
encoding/csv: fix error documentation
We should be referring to ParseError.Err, which is the underlying error, not ParseError.Error, which is the error method. Change-Id: Ic3cef5ecbe1ada5fa14b9573222f29da8fc9a8d5 Reviewed-on: https://go-review.googlesource.com/72450 Reviewed-by: Tim Cooper <tim.cooper@layeh.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
4a0dcc2de1
commit
744da64947
@ -80,7 +80,7 @@ func (e *ParseError) Error() string {
|
|||||||
return fmt.Sprintf("parse error on line %d, column %d: %v", e.Line, e.Column, e.Err)
|
return fmt.Sprintf("parse error on line %d, column %d: %v", e.Line, e.Column, e.Err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are the errors that can be returned in ParseError.Error
|
// These are the errors that can be returned in ParseError.Err.
|
||||||
var (
|
var (
|
||||||
ErrTrailingComma = errors.New("extra delimiter at end of line") // Deprecated: No longer used.
|
ErrTrailingComma = errors.New("extra delimiter at end of line") // Deprecated: No longer used.
|
||||||
ErrBareQuote = errors.New("bare \" in non-quoted-field")
|
ErrBareQuote = errors.New("bare \" in non-quoted-field")
|
||||||
@ -315,7 +315,7 @@ parseField:
|
|||||||
// `"` sequence (bare quote).
|
// `"` sequence (bare quote).
|
||||||
r.recordBuffer = append(r.recordBuffer, '"')
|
r.recordBuffer = append(r.recordBuffer, '"')
|
||||||
default:
|
default:
|
||||||
// `"*` squence (invalid non-escaped quote).
|
// `"*` sequence (invalid non-escaped quote).
|
||||||
col := utf8.RuneCount(fullLine[:len(fullLine)-len(line)-quoteLen])
|
col := utf8.RuneCount(fullLine[:len(fullLine)-len(line)-quoteLen])
|
||||||
err = &ParseError{RecordLine: recLine, Line: r.numLine, Column: col, Err: ErrQuote}
|
err = &ParseError{RecordLine: recLine, Line: r.numLine, Column: col, Err: ErrQuote}
|
||||||
break parseField
|
break parseField
|
||||||
|
Loading…
Reference in New Issue
Block a user