packagefilesimport"io"// ReaderFile is a implementation of File created from an `io.Reader`.// ReaderFiles are never directories, and can be read from and closed.typeReaderFilestruct{FilenamestringReaderio.Reader}func(f*ReaderFile)IsDirectory()bool{returnfalse}func(f*ReaderFile)NextFile()(File,error){returnnil,ErrNotDirectory}func(f*ReaderFile)FileName()string{returnf.Filename}func(f*ReaderFile)Read(p[]byte)(int,error){returnf.Reader.Read(p)}func(f*ReaderFile)Close()error{closer,ok:=f.Reader.(io.Closer)if!ok{returnnil}returncloser.Close()}