Skip to content

Instantly share code, notes, and snippets.

View threeaccents's full-sized avatar

Rodrigo Lessa threeaccents

View GitHub Profile
@threeaccents
threeaccents / openbrowser.go
Created February 25, 2016 18:55
open chrome browser with golang function
// openBrowser tries to open the URL in a browser,
// and returns whether it succeed in doing so.
func openBrowser(url string) bool {
var args []string
switch runtime.GOOS {
case "darwin":
args = []string{"open"}
case "windows":
args = []string{"cmd", "/c", "start"}
default: