Skip to content

Commit

Permalink
Add package name when using NewDecoder function (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
soartec-lab authored Sep 10, 2023
1 parent 0805d99 commit 05adbbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ the incoming data before the actual decoding takes place.
Lets say we want to decode some floats and the csv input contains some NaN values, but these values are represented by the 'n/a' string. An attempt to decode 'n/a' into float will end up with error, because strconv.ParseFloat expects 'NaN'. Knowing that, we can implement a Map function that will normalize our 'n/a' string and turn it to 'NaN' only for float types.

```go
dec, err := NewDecoder(r)
dec, err := csvutil.NewDecoder(r)
if err != nil {
log.Fatal(err)
}
Expand All @@ -245,7 +245,7 @@ Some files may use different value separators, for example TSV files would use `
csvReader := csv.NewReader(r)
csvReader.Comma = '\t'

dec, err := NewDecoder(csvReader)
dec, err := csvutil.NewDecoder(csvReader)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 05adbbb

Please sign in to comment.