diff --git a/test/conformance/walk.go b/test/conformance/walk.go index ec60ae87196..db5a9f4e99a 100644 --- a/test/conformance/walk.go +++ b/test/conformance/walk.go @@ -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 {