mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
parent
302735097e
commit
1d9ef34ec7
@ -385,6 +385,7 @@ func (s *Source) SetID() {
|
|||||||
case FileScheme:
|
case FileScheme:
|
||||||
// attempt to use the digest of the contents of the file as the ID
|
// attempt to use the digest of the contents of the file as the ID
|
||||||
file, err := os.Open(s.Metadata.Path)
|
file, err := os.Open(s.Metadata.Path)
|
||||||
|
defer file.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
d = digest.FromString(s.Metadata.Path).String()
|
d = digest.FromString(s.Metadata.Path).String()
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user