version

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version holds build information. Release builds set the variables with -ldflags -X.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"goVersion"`
	Platform  string `json:"platform"`
}

Info describes the running binary.

func Get

func Get() Info

Get returns the build information. When ldflags are not set (for example with `go install`), it falls back to the module and VCS data embedded by the Go toolchain.

func (Info) WriteText

func (i Info) WriteText(w io.Writer) error

WriteText writes the human-readable form.

Jump to

Keyboard shortcuts

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