mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-22 07:31:10 +00:00
docs: fix errors in encoding/csv examples
Fix 1 is passing an `io.Stream` to `reader_init` instead of a `FileStream`. Fix 2 is an `err` that should (probably?) have been `csv_err`.
This commit is contained in:
@@ -49,7 +49,7 @@ Example:
|
||||
fmt.eprintfln("Unable to open file: %v. Error: %v", filename, err)
|
||||
return
|
||||
}
|
||||
csv.reader_init(&r, handle.stream)
|
||||
csv.reader_init(&r, os.to_stream(handle))
|
||||
|
||||
for r, i in csv.iterator_next(&r) {
|
||||
for f, j in r {
|
||||
@@ -67,7 +67,7 @@ Example:
|
||||
|
||||
csv_data, csv_err := os.read_entire_file(filename, context.allocator)
|
||||
defer delete(csv_data, context.allocator)
|
||||
if err != nil {
|
||||
if csv_err != nil {
|
||||
fmt.eprintfln("Unable to open file: %v. Error: %v", filename, csv_err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user