Skip to content

Commit 62a55b6

Browse files
committed
return EOF on output type map
1 parent e5f6290 commit 62a55b6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

gss/DeserializeCSV.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ func DeserializeCSV(input io.Reader, format string, input_header []string, input
4545
if output_type.Kind() == reflect.Map {
4646
inRow, err := reader.Read()
4747
if err != nil {
48-
return nil, errors.Wrap(err, "error reading row from input with format csv")
48+
if err == io.EOF {
49+
return nil, err
50+
}
51+
return nil, errors.Wrap(err, "error reading row into map from input with format csv")
4952
}
5053
if len(inRow) == 0 {
5154
return nil, &ErrEmptyRow{}
@@ -79,7 +82,7 @@ func DeserializeCSV(input io.Reader, format string, input_header []string, input
7982
if err == io.EOF {
8083
break
8184
} else {
82-
return nil, errors.Wrap(err, "error reading row from input with format csv")
85+
return nil, errors.Wrap(err, "error reading row into slice from input with format csv")
8386
}
8487
}
8588
m := reflect.MakeMap(output_type.Elem())

0 commit comments

Comments
 (0)