version

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: GPL-3.0, LGPL-3.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 reports the build provenance of the clusterctl binary.

No version number is stored in the source tree. Release builds inject one from the signed git tag through -ldflags; every other build derives what it can from the VCS stamps the Go toolchain embeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Version is the release version, "v1.4.0" style: the one the release
	// build injected, or the module version "go install" built. It is
	// "devel" for any other build, a build from a checkout included.
	Version string `json:"version" yaml:"version"`
	// Commit is the git revision the binary was built from, empty when the
	// build carried no VCS information.
	Commit string `json:"commit,omitempty" yaml:"commit,omitempty"`
	// Date is the build or commit timestamp in RFC 3339 form.
	Date string `json:"date,omitempty" yaml:"date,omitempty"`
	// Dirty reports whether the working tree held uncommitted changes.
	Dirty bool `json:"dirty,omitempty" yaml:"dirty,omitempty"`
	// GoVersion is the toolchain that produced the binary.
	GoVersion string `json:"goVersion" yaml:"goVersion"`
	// Platform is the target the binary was built for.
	Platform string `json:"platform" yaml:"platform"`
}

Info describes the running binary.

func Get

func Get() Info

Get assembles the build provenance, preferring values injected at release time and falling back to the VCS stamps in the build info.

func (Info) String

func (i Info) String() string

String renders the provenance as a single human readable line.

Jump to

Keyboard shortcuts

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