mirror of
https://github.com/anchore/grype
synced 2024-09-20 14:31:59 +00:00
16 lines
199 B
Go
16 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()
|
||
|
}
|