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:
parent
c40579ac75
commit
0bbb6665d8
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user