grype/internal/file/exists.go
2020-06-19 10:57:06 -04:00

15 lines
199 B
Go

package file
import (
"os"
"github.com/spf13/afero"
)
func Exists(fs afero.Fs, path string) bool {
info, err := fs.Stat(path)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}