Hello,I would like to map file created withfind / >the_file(text file, each line one entry) into memory with golang and then iterate through it. For memory mapping there is
func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)which returns byte slice, now, to read a line I plan to reach byte by byte. Is there more effective approach?Is there something if I would replace newlines in the file with zero bytes?Thanks--
To answer your question, in the buffer package there are functions that allow you to read directly from the buffer using regular Read calls.