Created
March 27, 2015 18:20
-
-
Save shilov/66ca39a57078e0af2240 to your computer and use it in GitHub Desktop.
xdg-open chrome
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
package main | |
import ( | |
"os/exec" | |
) | |
func main() { | |
try := []string{"xdg-open", "google-chrome", "open"} | |
for _, bin := range try { | |
err := exec.Command(bin, "http://golang.org").Run() | |
if err == nil { | |
return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment