1
0
mirror of https://github.com/golang/go synced 2024-11-23 12:50:12 -07:00

os: call f.Close before t.Fatal to avoid vet unreachable code warnings

Change-Id: Ic3f756ecf9b4fad8fb8c259e7dad6df894863b0e
GitHub-Last-Rev: 303e524029
GitHub-Pull-Request: golang/go#41900
Reviewed-on: https://go-review.googlesource.com/c/go/+/261217
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Trust: Emmanuel Odeke <emm.odeke@gmail.com>
This commit is contained in:
gzdaijie 2020-10-12 05:39:16 +00:00 committed by Tobias Klauser
parent 9449a125e8
commit e92ce92662

View File

@ -1573,8 +1573,8 @@ func TestOpenError(t *testing.T) {
func TestOpenNoName(t *testing.T) {
f, err := Open("")
if err == nil {
t.Fatal(`Open("") succeeded`)
f.Close()
t.Fatal(`Open("") succeeded`)
}
}