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:
Stephen Hara
2026-07-18 20:27:33 +09:00
parent 6983813b4e
commit 8757541ba4

View File

@@ -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
}