Skip to content

Commit

Permalink
Fixes go-gitea#16557 - duplicate csv import
Browse files Browse the repository at this point in the history
  • Loading branch information
richmahn committed Aug 5, 2021
1 parent 3a1332c commit 432d48c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package csv

import (
"bytes"
"encoding/csv"
stdcsv "encoding/csv"
"errors"
"io"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 432d48c

Please sign in to comment.