opener

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 4 Imported by: 0

README

opener

Go Reference Go Report Card

A Go package that opens URLs in the user’s default browser, with support for Windows, macOS, Linux, and WSL.

Installation

go get github.com/andrewheberle/opener

Usage

import "github.com/andrewheberle/opener"

err := opener.OpenUrl("https://example.com")
if err != nil {
    log.Fatal(err)
}

Platform Support

Platform Method
Windows cmd /c start
macOS open
Linux xdg-open
WSL cmd /c start
FreeBSD / OpenBSD / NetBSD xdg-open

API

OpenUrl(url string) error

Opens the specified URL in the user’s default browser. Returns an error if the underlying command cannot be started.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenUrl

func OpenUrl(url string) error

OpenUrl opens the specified URL in the default browser of the user.

Types

This section is empty.

Jump to

Keyboard shortcuts

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