From 723b9eecb0c739d16e65132bd4c7074bd62e5e45 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 15 Jul 2020 12:43:48 -0700 Subject: [PATCH] net/interfaces: set SysProcAttr.HideWindow to prevent cmd.exe flash on Windows --- net/interfaces/interfaces_windows.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/interfaces/interfaces_windows.go b/net/interfaces/interfaces_windows.go index e16c297d9..5eae126d2 100644 --- a/net/interfaces/interfaces_windows.go +++ b/net/interfaces/interfaces_windows.go @@ -6,6 +6,7 @@ import ( "os/exec" + "syscall" "go4.org/mem" "inet.af/netaddr" @@ -41,6 +42,7 @@ func init() { */ func likelyHomeRouterIPWindows() (ret netaddr.IP, ok bool) { cmd := exec.Command("route", "print", "-4") + cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} stdout, err := cmd.StdoutPipe() if err != nil { return