Skip to content

Instantly share code, notes, and snippets.

@shilov
Created Mar 27, 2015
Embed
What would you like to do?
xdg-open chrome
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