net/interfaces: set SysProcAttr.HideWindow to prevent cmd.exe flash on Windows

reviewable/pr560/r1
Brad Fitzpatrick 4 years ago
parent df674d4189
commit 723b9eecb0

@ -6,6 +6,7 @@ package interfaces
import ( import (
"os/exec" "os/exec"
"syscall"
"go4.org/mem" "go4.org/mem"
"inet.af/netaddr" "inet.af/netaddr"
@ -41,6 +42,7 @@ Network Destination Netmask Gateway Interface Metric
*/ */
func likelyHomeRouterIPWindows() (ret netaddr.IP, ok bool) { func likelyHomeRouterIPWindows() (ret netaddr.IP, ok bool) {
cmd := exec.Command("route", "print", "-4") cmd := exec.Command("route", "print", "-4")
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
stdout, err := cmd.StdoutPipe() stdout, err := cmd.StdoutPipe()
if err != nil { if err != nil {
return return

Loading…
Cancel
Save