Last active
September 3, 2018 15:56
-
-
Save selfup/72dc6c16621e3f09a50153e863f62924 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch runtime.GOOS { | |
case "darwin": | |
exec.Command("open", "http://localhost:8792").Run() | |
break | |
case "windows": | |
exec.Command("cmd.exe", "/C", "start "+"http://localhost:8792").Run() | |
break | |
default: | |
cmd := exec.Command("xdg-open", "http://localhost:8792") | |
cmd.SysProcAttr = &syscall.SysProcAttr{ | |
Setpgid: true, | |
} | |
cmd.Run() | |
break | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment