version

package
v0.0.0-...-50a2d83 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionFalse versionValue = false
	VersionTrue  versionValue = true
)

Variables

View Source
var (
	GitVersion   = "v0.0.0"               // tag
	BuildDate    = "1970-01-01T00:00:00Z" // 构建时间
	GitCommit    = "$Format:%H$"          // Commit ID
	GitTreeState = "dirty"                // Git 树的状态,"clean" or "dirty"
)

Functions

func PrintAndExitIfRequested

func PrintAndExitIfRequested()

func Version

func Version(name string, value versionValue, usage string) *versionValue

Types

type Info

type Info struct {
	GitVersion   string `json:"gitVersion"`
	GitCommit    string `json:"gitCommit"`
	GitTreeState string `json:"gitTreeState"`
	BuildDate    string `json:"buildDate"`
	GoVersion    string `json:"goVersion"`
	Compiler     string `json:"compiler"`
	Platform     string `json:"platform"`
}

func Get

func Get() Info

func (Info) String

func (info Info) String() string

func (Info) Text

func (info Info) Text() ([]byte, error)

func (Info) ToJSON

func (info Info) ToJSON() string

Jump to

Keyboard shortcuts

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