mirror of https://github.com/golang/go.git
test: close file in goFiles
Brad's battery died on a plane and the file stayed open for 8 years without anyone noticing. 😄 Someone noticed in https://github.com/gopherjs/gopherjs/pull/950. Updates #2833 Change-Id: I46b28ac014a8c355be94e026615f119f96e5d51a Reviewed-on: https://go-review.googlesource.com/c/go/+/218700 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This commit is contained in:
parent
baea3cd7c9
commit
240498d635
|
|
@ -203,6 +203,7 @@ func goFiles(dir string) []string {
|
|||
f, err := os.Open(dir)
|
||||
check(err)
|
||||
dirnames, err := f.Readdirnames(-1)
|
||||
f.Close()
|
||||
check(err)
|
||||
names := []string{}
|
||||
for _, name := range dirnames {
|
||||
|
|
|
|||
Loading…
Reference in New Issue