github.com/nextlinux/gosbom@v0.81.1-0.20230627115839-1ff50c281391/internal/file/opener.go (about) 1 package file 2 3 import ( 4 "io" 5 "os" 6 ) 7 8 // Opener is an object that stores a path to later be opened as a file. 9 type Opener struct { 10 path string 11 } 12 13 // Open the stored path as a io.ReadCloser. 14 func (o Opener) Open() (io.ReadCloser, error) { 15 return os.Open(o.path) 16 }