version

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GitVersion 是语义化的版本号.
	GitVersion = "v0.1.0-alpha"
	// BuildDate 是 ISO8601 格式的构建时间, $(date -u +'%Y-%m-%dT%H:%M:%SZ') 命令的输出.
	BuildDate = "2026-04-16T00:00:00Z"
	// GitCommit 是 Git 的 SHA1 值,$(git rev-parse HEAD) 命令的输出.
	GitCommit = "$Format:%H$"
	// GitTreeState 代表构建时 Git 仓库的状态,可能的值有:clean, dirty.
	GitTreeState = ""
)

Functions

This section is empty.

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"`
}

Info 包含了版本信息.

func Get

func Get() Info

Get 返回详尽的代码库版本信息,用来标明二进制文件由哪个版本的代码构建.

func (Info) String

func (info Info) String() string

String 返回人性化的版本信息字符串.

func (Info) Text

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

Text 将版本信息编码为 UTF-8 格式的文本,并返回.

func (Info) ToJSON

func (info Info) ToJSON() string

ToJSON 以 JSON 格式返回版本信息.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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