1
0
mirror of https://github.com/golang/go synced 2024-11-26 20:21:25 -07:00

cmd/go: fix file leak in TestBuildmodePIE

Change-Id: Ifeb93f6dc75fb5f90d595211fb0f97a89bf74526
Reviewed-on: https://go-review.googlesource.com/64530
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Hiroshi Ioka 2017-09-19 16:31:03 +09:00 committed by Dave Cheney
parent c40579ac75
commit 0bbb6665d8

View File

@ -4474,6 +4474,7 @@ func TestBuildmodePIE(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer f.Close()
if f.Type != elf.ET_DYN {
t.Errorf("PIE type must be ET_DYN, but %s", f.Type)
}
@ -4482,6 +4483,7 @@ func TestBuildmodePIE(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer f.Close()
if f.Flags&macho.FlagDyldLink == 0 {
t.Error("PIE must have DyldLink flag, but not")
}