INNER CODE UNIT · Go
openBrowser
gimlet-io/capacitor · cli/cmd/main.go:27
func openBrowser(url string) error {
var cmd *exec.Cmd
switch runtime.GOOS {
case "darwin":
cmd = exec.Command("open", url)
case "windows":
cmd = exec.Command("cmd", "/c", "start", url)
case "linux":
cmd = exec.Command("xdg-open", url)
default:
return fmt.Errorf("unsupported platform")
}
return cmd.Start()
}
func main() {