mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Close leaking files in conformance/walk.go
We want to ensure we close this file handler if it was opened successfully.
This commit is contained in:
parent
d6035f3e0d
commit
f7128535bd
@ -180,6 +180,7 @@ func (v *visitor) comment(x *ast.BasicLit) string {
|
||||
//proximity of the comment and apply it.
|
||||
myf, err := os.Open(v.FileSet.File(x.Pos()).Name())
|
||||
if err == nil {
|
||||
defer myf.Close()
|
||||
if _, err := myf.Seek(int64(comm.End()), 0); err == nil {
|
||||
if _, err := myf.Read(b1); err == nil {
|
||||
if strings.Compare(strings.Trim(string(b1), "\t \r\n"), "framework.ConformanceIt(\"") == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user