mirror of
https://github.com/golang/go
synced 2024-11-17 14:44:44 -07:00
fix logic
This commit is contained in:
parent
a8874674ae
commit
fbbd8e10de
@ -274,11 +274,13 @@ func TestDNSNameLength(t *testing.T) {
|
||||
t.Fatal(conf.err)
|
||||
}
|
||||
|
||||
var shortestSuffix int
|
||||
if len(tt.want.search) == 0 {
|
||||
shortestSuffix = len(dnsDefaultSearch())
|
||||
suffixList := tt.want.search
|
||||
if len(suffixList) == 0 {
|
||||
suffixList = dnsDefaultSearch()
|
||||
}
|
||||
for _, suffix := range tt.want.search {
|
||||
|
||||
var shortestSuffix int
|
||||
for _, suffix := range suffixList {
|
||||
if shortestSuffix == 0 || len(suffix) < shortestSuffix {
|
||||
shortestSuffix = len(suffix)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user