Skip to content

Commit 047f07a

Browse files
committed
net: remove obsolete TestLookupHost
The motivation of TestLookupHost was to test codepaths on LookupHost, LookupIP when we set CGO_ENABLED=1. Now we have serveral tests on those APIs and their codepaths such as TestLookupGooglePublicDNSAddr, TestCgoLookupIP, TestGoLookupIP, and the test using the ambiguous source "localhost" is unnecessary. Fixes #11182. Change-Id: I397c823e1648114d91a229b316477bff2948b4f9 Reviewed-on: https://go-review.googlesource.com/11057 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 9585bb2 commit 047f07a

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/net/hosts_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package net
66

77
import (
88
"reflect"
9-
"sort"
109
"testing"
1110
)
1211

@@ -119,17 +118,3 @@ func TestLookupStaticAddr(t *testing.T) {
119118
}
120119
}
121120
}
122-
123-
func TestLookupHost(t *testing.T) {
124-
// Can't depend on this to return anything in particular,
125-
// but if it does return something, make sure it doesn't
126-
// duplicate addresses (a common bug due to the way
127-
// getaddrinfo works).
128-
addrs, _ := LookupHost("localhost")
129-
sort.Strings(addrs)
130-
for i := 0; i+1 < len(addrs); i++ {
131-
if addrs[i] == addrs[i+1] {
132-
t.Fatalf("LookupHost(\"localhost\") = %v, has duplicate addresses", addrs)
133-
}
134-
}
135-
}

0 commit comments

Comments
 (0)