Permalink
Browse files

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>
  • Loading branch information...
hirochachacha authored and davecheney committed Sep 19, 2017
1 parent c40579a commit 0bbb6665d85c1e80c3b479a4c00dc8a0a1b83ec8
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/cmd/go/go_test.go
View
@@ -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")
}

0 comments on commit 0bbb666

Please sign in to comment.