mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
always return a cleanup function from scope (#183)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
+2
-2
@@ -54,11 +54,11 @@ func NewScope(userInput string, o Option) (Scope, func(), error) {
|
||||
case directoryScheme:
|
||||
fileMeta, err := fs.Stat(location)
|
||||
if err != nil {
|
||||
return Scope{}, nil, fmt.Errorf("unable to stat dir=%q: %w", location, err)
|
||||
return Scope{}, func() {}, fmt.Errorf("unable to stat dir=%q: %w", location, err)
|
||||
}
|
||||
|
||||
if !fileMeta.IsDir() {
|
||||
return Scope{}, nil, fmt.Errorf("given path is not a directory (path=%q): %w", location, err)
|
||||
return Scope{}, func() {}, fmt.Errorf("given path is not a directory (path=%q): %w", location, err)
|
||||
}
|
||||
|
||||
s, err := NewScopeFromDir(location)
|
||||
|
||||
Reference in New Issue
Block a user