version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GitCommit is the git commit SHA
	GitCommit = "unknown"
	// GitDescribe is the output of git describe --tags --dirty
	GitDescribe = "unknown"
	// BuildDate is the date when the binary was built
	BuildDate = "unknown"
	// GoVersion is the Go version used to build the binary
	GoVersion = runtime.Version()
	// Platform is the OS/Architecture combination
	Platform = fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
)

Build information that will be set via ldflags during build

Functions

func GetFormattedBuildInfo

func GetFormattedBuildInfo() string

GetFormattedBuildInfo returns formatted build information for logging

Types

type Info

type Info struct {
	GitCommit   string `json:"gitCommit"`
	GitDescribe string `json:"gitDescribe"`
	BuildDate   string `json:"buildDate"`
	GoVersion   string `json:"goVersion"`
	Platform    string `json:"platform"`
}

Info holds all the version information

func Get

func Get() Info

Get returns the version information

func (Info) String

func (i Info) String() string

String returns a formatted string with all version information

Jump to

Keyboard shortcuts

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