version

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 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

Overview

Package version 提供 Runtime 版本与构建信息的注入点。

Version、Commit 与 BuildDate 由构建期 -ldflags 写入,未注入时保持稳定占位; hello.runtimeVersion 与 version 命令共享同一份 Info 快照。

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version 是 Runtime 发布版本,构建期通过 -ldflags -X 注入。
	Version = "dev"
	// Commit 是构建对应的提交哈希,可为空字符串。
	Commit = ""
	// BuildDate 是构建时间,可为空字符串。
	BuildDate = ""
)

Functions

func ProductBranch added in v0.1.15

func ProductBranch(productVersion string) string

ProductBranch 固定产品版本的后端分支;调用方仍需校验安全版本字符。 仅规范 alpha 版本进入滚动 dev,历史非标准版本继续按 release 规则定位。

Types

type Info

type Info struct {
	Version   string
	Protocol  int
	Commit    string
	BuildDate string
	GoVersion string
}

Info 是 version 命令与 hello 共享的版本信息快照。

func Load

func Load(ctx context.Context) (Info, error)

Load 返回当前构建的版本信息;生产路径不会失败。

Jump to

Keyboard shortcuts

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