tally/open_browser_windows.go

14 lines
332 B
Go
Raw Normal View History

2021-05-08 21:53:33 +00:00
// This will only build for windows based on the filename
// no build tag required
package main
2021-05-08 21:53:33 +00:00
import "os/exec"
func OpenInBrowser(url string) (string, error) {
err := exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
if err != nil {
return "", err
}
return "Opened in system default web browser", nil
}