github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/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  }