mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
fix closing files
This commit is contained in:
parent
29a8f4c09e
commit
c5aa8e6da3
1 changed files with 3 additions and 0 deletions
|
|
@ -93,6 +93,7 @@ func FromFiles(ctx context.Context, ignoreFilePatterns []string, paths ...string
|
|||
f, err := os.Open(p)
|
||||
if err != nil {
|
||||
errors <- DiscoveryError{p, err}
|
||||
continue
|
||||
}
|
||||
|
||||
scanner := bufio.NewScanner(f)
|
||||
|
|
@ -109,6 +110,8 @@ func FromFiles(ctx context.Context, ignoreFilePatterns []string, paths ...string
|
|||
if nRes == 0 {
|
||||
resources <- Resource{Path: p, Bytes: []byte{}}
|
||||
}
|
||||
|
||||
f.Close()
|
||||
}
|
||||
|
||||
close(errors)
|
||||
|
|
|
|||
Loading…
Reference in a new issue