-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding/csv: add Reader.InputOffset method #43401
Comments
For the encoding/json package it made sense to add Still, symmetry with the other packages is a reasonable argument. |
It makes sense here, too. It is sometimes necessary to have random access to the rows, so that you can read some of them without reading the entire (possibly huge) file. I've implemented a simple inverted index, where the documents are rows from CSV files. Every document ID is mapped to a filename and a row offset. When I query the index, I can read only the rows that match by seeking to the offsets. There's also this question on StackOverflow: https://stackoverflow.com/questions/22875018/read-random-lines-off-a-text-file-in-go |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Change https://go.dev/cl/405675 mentions this issue: |
encoding/json.Decoder
already has a method like this:https://golang.org/pkg/encoding/json/#Decoder.InputOffset
The text was updated successfully, but these errors were encountered: