version

package
v0.0.0-...-94a580d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   string
	Revision  string
	Branch    string
	BuildUser string
	BuildDate string
	Toolchain = runtime.Version()
	Arch      = runtime.GOARCH
)

Build information. Populated at build-time.

Functions

This section is empty.

Types

type BuildInformation

type BuildInformation struct {
	Version   string `json:"version" mapstructure:"version"`
	Revision  string `json:"revision" mapstructure:"revision"`
	Branch    string `json:"branch" mapstructure:"branch"`
	BuildDate string `json:"build_date" mapstructure:"build_date"`
	Toolchain string `json:"toolchain" mapstructure:"toolchain"`
	BuildUser string `json:"build_user" mapstructure:"build_user"`
	Arch      string `json:"arch" mapstructure:"arch"`
}

BuildInformation helps with working with immutable build information.

func New

func New() *BuildInformation

New returns a new BuildInformation.

func (*BuildInformation) BuildContext

func (b *BuildInformation) BuildContext() string

BuildContext returns toolchain, buildUser and buildDate information.

func (*BuildInformation) Info

func (b *BuildInformation) Info() string

Info returns version, branch and revision information.

func (*BuildInformation) ToString

func (b *BuildInformation) ToString() string

Print returns version information.

Jump to

Keyboard shortcuts

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