]> Cypherpunks repositories - gostls13.git/commitdiff
test: close file in goFiles
authorDmitri Shuralyov <dmitshur@golang.org>
Sun, 9 Feb 2020 00:43:58 +0000 (19:43 -0500)
committerDmitri Shuralyov <dmitshur@golang.org>
Fri, 21 Feb 2020 22:00:03 +0000 (22:00 +0000)
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>
test/run.go

index a7bee6527597a91c732f033ae9997740072beee3..7129ca32284c486fc638469b7b31a77435e6ae1f 100644 (file)
@@ -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 {