File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -441,8 +441,19 @@ func TestLookupDotsWithLocalSource(t *testing.T) {
441
441
if i == 1 {
442
442
mode = "netcgo"
443
443
}
444
- for _ , name := range names {
444
+ loop:
445
+ for i , name := range names {
445
446
if strings .Index (name , "." ) == len (name )- 1 { // "localhost" not "localhost."
447
+ for j := range names {
448
+ if j == i {
449
+ continue
450
+ }
451
+ if names [j ] == name [:len (name )- 1 ] {
452
+ // It's OK if we find the name without the dot,
453
+ // as some systems say 127.0.0.1 localhost localhost.
454
+ continue loop
455
+ }
456
+ }
446
457
t .Errorf ("%s: got %s; want %s" , mode , name , name [:len (name )- 1 ])
447
458
} else if strings .Contains (name , "." ) && ! strings .HasSuffix (name , "." ) { // "localhost.localdomain." not "localhost.localdomain"
448
459
t .Errorf ("%s: got %s; want name ending with trailing dot" , mode , name )
You can’t perform that action at this time.
0 commit comments