version

package module
v0.1.24 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the current version
	Version = "0.0.0"

	// Branch is current branch name the code is built off.
	Branch = "unknown"

	// Revision is the short commit hash of source tree
	Revision = "unknown"

	// BuiltAt is the build time
	BuiltAt = "unknown"

	// GoVersion is the go version used to build
	GoVersion = "unknown"
)

These variables are set during build time

Functions

func Flags

func Flags()

Flags handle version flags

func Print

func Print()

Print prints version information to stdout

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Branch    string `json:"branch"`
	Revision  string `json:"revision"`
	BuiltAt   string `json:"builtAt"`
	GoVersion string `json:"goVersion"`
}

Info contains version information

func GetVersionInfo

func GetVersionInfo() Info

GetVersionInfo returns version information with runtime git info

func (Info) JSON

func (i Info) JSON() string

JSON returns a JSON representation of version information

func (Info) String

func (i Info) String() string

String returns a string representation of version information

Jump to

Keyboard shortcuts

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