2021-05-08 21:53:33 +00:00
|
|
|
// This will only build for windows based on the filename
|
|
|
|
// no build tag required
|
2021-05-08 21:58:45 +00:00
|
|
|
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
|
|
|
|
}
|