browser

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunOpen

func RunOpen(opener Opener, out io.Writer, rawURL string) error

RunOpen validates the URL, opens it, and prints a confirmation.

func ValidateURL

func ValidateURL(rawURL string) error

ValidateURL checks that rawURL is non-empty, parseable, and uses http or https.

Types

type DefaultOpener

type DefaultOpener struct{}

DefaultOpener uses platform-specific commands to open URLs without blocking.

func (DefaultOpener) Open

func (DefaultOpener) Open(rawURL string) error

type Opener

type Opener interface {
	Open(url string) error
}

Opener opens a URL in the default browser.

Jump to

Keyboard shortcuts

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