Skip to content

Commit

Permalink
fix redundant WindowsDNS (#1456)
Browse files Browse the repository at this point in the history
Co-authored-by: ForestL <[email protected]>
  • Loading branch information
Larvan2 and ForestL18 committed Aug 20, 2024
1 parent ba605b6 commit 512d188
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dns/system_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"syscall"
"unsafe"

"golang.org/x/exp/slices"
"golang.org/x/sys/windows"
)

Expand Down Expand Up @@ -40,6 +41,9 @@ func dnsReadConfig() (servers []string, err error) {
// Unexpected type.
continue
}
if slices.Contains(servers, ip.String()) {
continue
}
servers = append(servers, ip.String())
}
}
Expand Down

0 comments on commit 512d188

Please sign in to comment.