MCPcopy Create free account
hub / github.com/efficientgo/e2e / OpenInBrowser

Function OpenInBrowser

interactive/interactive.go:22–36  ·  view source on GitHub ↗

OpenInBrowser opens given URL in your default browser.

(url string)

Source from the content-addressed store, hash-verified

20
21// OpenInBrowser opens given URL in your default browser.
22func OpenInBrowser(url string) error {
23 fmt.Println("Opening", url, "in browser.")
24 var err error
25 switch runtime.GOOS {
26 case "linux":
27 err = exec.Command("xdg-open", url).Run()
28 case "windows":
29 err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Run()
30 case "darwin":
31 err = exec.Command("open", url).Run()
32 default:
33 err = errors.New("unsupported platform")
34 }
35 return err
36}
37
38// RunUntilEndpointHit stalls current goroutine executions and prints the URL to local address. When URL is hit
39// this function returns with nil to continue the execution. It also watches for SIGINT, SIGKILL or SIGHUP signals

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…