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:
io.Reader
Here is an example where we open a text file and create an io.Reader from the returned *os.File instance f
package main import ( "io" "os" ) func main() { f, err := os.Open("somefile.txt") if err != nil { panic(err) } defer f.Close() var r io.Reader r = f }