Skip to content

Commit

Permalink
Issue #586: win: Remove some dead code
Browse files Browse the repository at this point in the history
This was pointed out by 'make lint'

#586
  • Loading branch information
cfergeau authored and gbraad committed Sep 20, 2019
1 parent 2c4ec66 commit 5ee20b1
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions pkg/crc/services/dns/dns_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,13 @@ func contains(s []string, e string) bool {
return false
}

func formatValues(serverAddresses []string) string {
var out string
for index, serverAddress := range serverAddresses {
out = fmt.Sprintf(`%s"%s"`, out, serverAddress)
if index < len(serverAddresses)-1 {
out = fmt.Sprintf(`%s, `, out)
}
}

return out
}

func setInterfaceNameserverValue(iface string, address string) {
exe := "netsh"
args := fmt.Sprintf(`interface ip set dns "%s" static %s primary`, iface, address)

win32.ShellExecuteAsAdmin(fmt.Sprintf("add dns server address to interface %s", iface), win32.HWND_DESKTOP, exe, args, "", 0)
}

func getMainInterface() string {
getMainInterfaceCommand := `(Get-NetAdapter | Where-Object {$_.MediaConnectionState -eq 'Connected'} | Sort-Object LinkSpeed -Descending)[0].Name`
mainInterface, _, _ := powershell.Execute(getMainInterfaceCommand)

return strings.TrimSpace(mainInterface)
}

func parseLines(input string) []string {
output := []string{}

Expand Down

0 comments on commit 5ee20b1

Please sign in to comment.