mirror of
https://github.com/golang/go
synced 2024-11-25 01:08:02 -07:00
old/template: close file in TestAll before deleting it
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5491073
This commit is contained in:
parent
7c94dc04a7
commit
448d89d67a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user