File: open_browser_darwin.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-- 284 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
// This will build for osx without a build tag based on the filename

package http

import "os/exec"

func OpenInBrowser(url string) (string, error) {
	err := exec.Command("open", url).Start()
	if err != nil {
		return "", err
	}
	return "Opened in system default web browser", nil
}