version

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 2 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 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

func (Info) JSON

func (i Info) JSON() (string, error)

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