-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
os: File.SeekLine method #23219
Comments
No thank you. This doesn’t need to live in the standard library so I recommend you develop it in your own package.
… On 22 Dec 2017, at 14:53, Sam Kleiner ***@***.***> wrote:
Wanted to see if there was any interest in this feature for os.File. Link below. Works just like Seek, except it steps by newlines.
Go is a big project, so before I went to the trouble of making a legit patch and making sure I don't break anything I wanted to see if there was interest in adding it.
https://github.com/StoicPerlman/fls
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
There are already pieces in the standard library for working with lines, such as https://golang.org/pkg/bufio/#Scanner. Or, if you need to go backwards and forwards instead of in a stream, you should instead split the input into a slice of lines with I also think that this is an unnecessary clutter of |
I figured that would be the answer. The ultimate goal for this is to be able to seek by any delimiter, but handling a > 1 byte delimiter adds some complexity that I didn't feel like doing before I knew if there was interest. I personally think seeking through a file for a delimiter is a pretty basic function. The reason this was necessary is because nothing in bufio can seek line by line and return the position in the file. So Scanner could not meet my use case. If anyone else stumbles on this and needs it feel free to checkout fls. |
Wanted to see if there was any interest in this feature for os.File. Link below. Works just like Seek, except it steps by newlines.
Go is a big project, so before I went to the trouble of making a legit patch and making sure I don't break anything I wanted to see if there was interest in adding it.
https://github.com/StoicPerlman/fls
The text was updated successfully, but these errors were encountered: