buildinfo

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 0 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 buildinfo exposes metadata embedded by the Go linker at build time.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version 由发布构建通过 -ldflags -X 覆盖;本地开发构建保留可识别的默认值。

Functions

This section is empty.

Types

type Info

type Info struct {
	Version string `json:"version"`
}

Info 是 CLI 可安全展示的构建元数据。

func Current

func Current() Info

Current 返回当前二进制嵌入的构建元数据。

func (Info) IsDevelopment

func (info Info) IsDevelopment() bool

IsDevelopment 仅根据版本号判断开发构建,供更新功能在未来拒绝 dev 二进制时使用。

Jump to

Keyboard shortcuts

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