summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2021-08-05 10:56:11 -0600
committerGitHub <noreply@github.com>2021-08-05 17:56:11 +0100
commitfd39e6dc6a183a2779d22f4e63f9be6d716db794 (patch)
tree70dfcb6dd2d012d7756427af1b791d5fbeaeeeea /modules
parent3a1332c326a4700e54e7bd6a0ef2bd050a6910b2 (diff)
downloadgitea-fd39e6dc6a183a2779d22f4e63f9be6d716db794.tar.gz
gitea-fd39e6dc6a183a2779d22f4e63f9be6d716db794.zip
Fixes #16557 - duplicate csv import (#16631)
Remove the unnecessary duplicate package import for `encoding/csv` in `modules/csv/csv.go` Fix #16557
Diffstat (limited to 'modules')
-rw-r--r--modules/csv/csv.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/csv/csv.go b/modules/csv/csv.go
index bf433f77d2..35486edd88 100644
--- a/modules/csv/csv.go
+++ b/modules/csv/csv.go
@@ -6,7 +6,6 @@ package csv
import (
"bytes"
- "encoding/csv"
stdcsv "encoding/csv"
"errors"
"io"
@@ -97,9 +96,9 @@ func scoreDelimiter(lines []string, delim rune) float64 {
// FormatError converts csv errors into readable messages.
func FormatError(err error, locale translation.Locale) (string, error) {
- var perr *csv.ParseError
+ var perr *stdcsv.ParseError
if errors.As(err, &perr) {
- if perr.Err == csv.ErrFieldCount {
+ if perr.Err == stdcsv.ErrFieldCount {
return locale.Tr("repo.error.csv.invalid_field_count", perr.Line), nil
}
return locale.Tr("repo.error.csv.unexpected", perr.Line, perr.Column), nil