Windows doesn't have SysProcAttr

This commit is contained in:
Jakob Borg
2014-05-02 08:57:34 +02:00
parent 45403917de
commit 89dc5bb951
3 changed files with 32 additions and 39 deletions

View File

@@ -0,0 +1,23 @@
// +build !windows
package main
import (
"os/exec"
"runtime"
"syscall"
)
func openURL(url string) error {
switch runtime.GOOS {
case "darwin":
return exec.Command("open", url).Run()
default:
cmd := exec.Command("xdg-open", url)
cmd.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
return cmd.Run()
}
}