package main import ( "context" "os/exec" "strings" "time" ) func systemProxy() string { ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second) defer cancel() out, e := exec.CommandContext(ctx, "powershell.exe", "-NoProfile", "-NonInteractive", "-Command", `$u=[uri]'https://services.gradle.org';$p=[System.Net.WebRequest]::GetSystemWebProxy();if(-not $p.IsBypassed($u)){$p.GetProxy($u).AbsoluteUri}`).Output() if e != nil { return "" } return strings.TrimSpace(string(out)) }