github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/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  }