mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
17 lines
308 B
Go
17 lines
308 B
Go
|
|
package open
|
||
|
|
|
||
|
|
import (
|
||
|
|
"os/exec"
|
||
|
|
"syscall"
|
||
|
|
)
|
||
|
|
|
||
|
|
func browser(url string) error {
|
||
|
|
cmd := exec.Command("cmd", "/c", "start", url)
|
||
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||
|
|
// HideWindow avoids a brief cmd console from opening
|
||
|
|
// before the browser opens the URL.
|
||
|
|
HideWindow: true,
|
||
|
|
}
|
||
|
|
return cmd.Run()
|
||
|
|
}
|