I would like to open a local file, and return a io.Reader
. The reason is that I need to feed a io.Reader
to a library I am using, like:
Use os.Open():
func Open(name string) (file *File, err error)
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY. If there is an error, it will be of type *PathError.
The returned value of type *os.File
implements the io.Reader
interface.