File: open_browser_windows.go

package info (click to toggle)
bombadillo 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: makefile: 59
file content (13 lines) | stat: -rw-r--r-- 332 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
// This will only build for windows based on the filename
// no build tag required
package http

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
}