debug/elf: fix nil deref in test

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews
https://golang.org/cl/109470044
This commit is contained in:
Dmitriy Vyukov 2014-07-05 08:48:46 +04:00
parent 67afeac2ab
commit 735e38cace
1 changed files with 1 additions and 1 deletions

View File

@ -166,11 +166,11 @@ func TestOpen(t *testing.T) {
} else {
f, err = Open(tt.file)
}
defer f.Close()
if err != nil {
t.Errorf("cannot open file %s: %v", tt.file, err)
continue
}
defer f.Close()
if !reflect.DeepEqual(f.FileHeader, tt.hdr) {
t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr)
continue