]> Cypherpunks repositories - gostls13.git/commitdiff
net: fix conf.teardown call in TestGoLookupIPOrderFallbackToFile
authorRuss Cox <rsc@golang.org>
Wed, 5 Jun 2019 16:33:30 +0000 (12:33 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 6 Jun 2019 00:11:40 +0000 (00:11 +0000)
If the test fails, conf.teardown wouldn't be.
It doesn't look like it matters much, but clean up anyway.

Change-Id: I45c18095abfd49422975d061be20cbd971a98f8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/180780
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/dnsclient_unix_test.go

index 1b67494e51ed35e8dbe60c126387a958560b2222..98304d36eab2d945ac51722a5f6d09f3da6cff2c 100644 (file)
@@ -589,6 +589,8 @@ func TestGoLookupIPOrderFallbackToFile(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
+       defer conf.teardown()
+
        if err := conf.writeAndUpdate([]string{}); err != nil {
                t.Fatal(err)
        }
@@ -620,7 +622,6 @@ func TestGoLookupIPOrderFallbackToFile(t *testing.T) {
                        t.Errorf("%s: address doesn't match expectation. got %v, want %v", name, got, want)
                }
        }
-       defer conf.teardown()
 }
 
 // Issue 12712.