open

package
v1.55.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package open provides utilities for opening URLs in a browser.

Index

Constants

This section is empty.

Variables

View Source
var StartCommand = func(cmd *exec.Cmd) error {
	return cmd.Start()
}

StartCommand starts an exec.Cmd. Overridden in tests to avoid launching a real browser.

Functions

func Browser

func Browser(url string) error

Browser takes a url and opens it using the default browser on the operating system

func CanOpenBrowser added in v1.5.7

func CanOpenBrowser() bool

CanOpenBrowser determines if no browser is set in linux

func OpenURL added in v1.43.3

func OpenURL(ctx context.Context, u *url.URL, allowedHosts map[string]bool) error

OpenURL opens the given URL in the user's default browser. allowedHosts restricts which hostnames may be opened; pass nil to allow any https URL. The URL must use the https scheme.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL