version

package
v0.165.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 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 version carries build metadata, injected at link time via -ldflags.

Index

Constants

This section is empty.

Variables

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

These are overridden at build time (see Makefile).

Functions

func Build added in v0.158.1

func Build() string

Build names this binary for keying cached scan results: the version and the commit, as `0.158.1+abcdef12`.

A release names itself by its version alone. A development build is "dev" whatever it contains, so the commit is what tells two of them apart: the linker's stamp under `make build`, or the VCS revision the Go toolchain recorded under `go build` in a checkout. A build with neither, such as a test binary, is `dev+none`.

func String

func String() string

String returns a human-readable version line.

Types

type Info added in v0.32.0

type Info struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	Built   string `json:"built"`
	Go      string `json:"go"`
}

Info is the build metadata in structured form, for machine consumers.

func Current added in v0.32.0

func Current() Info

Current returns the build metadata this binary was stamped with.

Jump to

Keyboard shortcuts

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