Skip to content

Instantly share code, notes, and snippets.

@shilov
Created March 27, 2015 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shilov/66ca39a57078e0af2240 to your computer and use it in GitHub Desktop.
Save shilov/66ca39a57078e0af2240 to your computer and use it in GitHub Desktop.
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