From: Josh Bleecher Snyder Date: Thu, 12 Dec 2013 06:12:06 +0000 (+0400) Subject: net: don't leave hostsPath unrestored on error in TestLookupStaticHost X-Git-Tag: go1.3beta1~1261 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cf51702bba18cf15e4f4aca1db6bf33bfa349d64;p=gostls13.git net: don't leave hostsPath unrestored on error in TestLookupStaticHost 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 --- diff --git a/src/pkg/net/hosts_test.go b/src/pkg/net/hosts_test.go index b07ed0baa9..2fe358e079 100644 --- a/src/pkg/net/hosts_test.go +++ b/src/pkg/net/hosts_test.go @@ -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 {