]> Cypherpunks repositories - gostls13.git/commitdiff
net: don't leave hostsPath unrestored on error in TestLookupStaticHost
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 12 Dec 2013 06:12:06 +0000 (10:12 +0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 12 Dec 2013 06:12:06 +0000 (10:12 +0400)
If the return was reached, then hostsPath would not be properly restored
to its original value. See the (lengthy) discussion at
https://golang.org/cl/15960047/

I assume that this is not for Go 1.2; mailing now since I promised to do so.
I will plan to ping once Go 1.2 is out.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/16200043

src/pkg/net/hosts_test.go

index b07ed0baa942df8444ea668275a2354f2797c4fe..2fe358e079c620d59e7548f3c33e9b9bebd3b55f 100644 (file)
@@ -41,7 +41,7 @@ func TestLookupStaticHost(t *testing.T) {
                if len(ips) != len(tt.ips) {
                        t.Errorf("# of hosts = %v; want %v",
                                len(ips), len(tt.ips))
-                       return
+                       continue
                }
                for k, v := range ips {
                        if tt.ips[k].String() != v {