LinuxCommandLibrary

go-bug

Debug Go programs

TLDR

Open a web page to start a bug report

$ go bug
copy

SYNOPSIS

go bug [package-path]

PARAMETERS

package-path
    Optional import path of a Go package; prefills issue form with package details if specified.

DESCRIPTION

The go bug command is a convenience tool in the Go programming language toolchain that launches your default web browser to the Go project's official bug tracker on GitHub. Specifically, it directs to https://github.com/golang/go/issues/new, allowing users to file new issues efficiently.

Without arguments, it opens a blank new issue form. If provided with a package path (e.g., net/http), it intelligently prefills the issue title and body with relevant details about the package, such as its import path, synopsis, and Go version, streamlining the bug reporting process.

This command integrates with system utilities like xdg-open (on Linux), open (macOS), or start (Windows) to handle browser invocation. It relies on the $BROWSER environment variable or platform defaults. Ideal for developers encountering issues in the standard library or core tooling, it reduces friction in contributing to Go's quality.

Usage is straightforward within any Go workspace, requiring no additional setup beyond a standard Go installation.

CAVEATS

Requires graphical environment and configured browser; fails silently or with error in headless/TTY-only sessions. Prefill works only for importable packages in $GOROOT or $GOPATH.

EXAMPLES

go bug
Opens generic new issue page.

go bug net/http
Opens new issue prefilled with net/http package info, including synopsis and version.

BROWSER DETECTION

Uses $BROWSER, xdg-open, or platform equivalents. Set $BROWSER for custom control, e.g., export BROWSER=firefox.

HISTORY

Introduced in Go 1.1 (February 2014) to simplify bug reporting. Evolved with Go releases; package prefilling added early on. Maintained as part of core go toolchain for all platforms since inception.

SEE ALSO

Copied to clipboard