Commit 448d89d6 authored by Alex Brainman's avatar Alex Brainman

old/template: close file in TestAll before deleting it

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5491073
parent 7c94dc04
......@@ -468,7 +468,11 @@ func TestAll(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer os.Remove(f.Name())
defer func() {
name := f.Name()
f.Close()
os.Remove(name)
}()
testAll(t, func(test *Test) (*Template, error) {
err := ioutil.WriteFile(f.Name(), []byte(test.in), 0600)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment