buildinfo

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package buildinfo hosts build info variables populated via ldflags.

Index

Constants

View Source
const DefaultVersion = "v0.0.0-dev"

DefaultVersion is the default value for Version if not set via ldflags.

Variables

View Source
var (
	// Version is the build version. If not set at build time via
	// ldflags, Version takes the value of DefaultVersion.
	Version = DefaultVersion

	// Commit is the commit hash.
	Commit string

	// Timestamp is the timestamp of when the cli was built.
	Timestamp string
)

Functions

func IsDefaultVersion added in v0.21.0

func IsDefaultVersion() bool

IsDefaultVersion returns true if Version is empty or DefaultVersion.

Types

type BuildInfo added in v0.21.0

type BuildInfo struct {
	Version   string `json:"version"`
	Commit    string `json:"commit,omitempty"`
	Timestamp string `json:"timestamp,omitempty"`
}

BuildInfo encapsulates Version, Commit and Timestamp.

func Info added in v0.21.0

func Info() BuildInfo

Info returns BuildInfo.

func (BuildInfo) String added in v0.21.0

func (bi BuildInfo) String() string

String returns a string representation of BuildInfo.

Jump to

Keyboard shortcuts

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