mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-24 20:27:02 +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)
|
f, err := os.Open(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors <- DiscoveryError{p, err}
|
errors <- DiscoveryError{p, err}
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
scanner := bufio.NewScanner(f)
|
scanner := bufio.NewScanner(f)
|
||||||
|
|
@ -109,6 +110,8 @@ func FromFiles(ctx context.Context, ignoreFilePatterns []string, paths ...string
|
||||||
if nRes == 0 {
|
if nRes == 0 {
|
||||||
resources <- Resource{Path: p, Bytes: []byte{}}
|
resources <- Resource{Path: p, Bytes: []byte{}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
close(errors)
|
close(errors)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue