Skip to content

Commit a6856eb

Browse files
committed
fix redundant WindowsDNS (#1456)
Co-authored-by: ForestL<[email protected]>
1 parent ba605b6 commit a6856eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dns/system_windows.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"syscall"
99
"unsafe"
1010

11+
"golang.org/x/exp/slices"
1112
"golang.org/x/sys/windows"
1213
)
1314

@@ -40,6 +41,9 @@ func dnsReadConfig() (servers []string, err error) {
4041
// Unexpected type.
4142
continue
4243
}
44+
if slices.Contains(servers, ip.String()) {
45+
continue
46+
}
4347
servers = append(servers, ip.String())
4448
}
4549
}

0 commit comments

Comments
 (0)