Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintBuildInfo ¶ added in v0.0.92
func PrintBuildInfo()
PrintBuildInfo prints the build information in JSON format. This function uses the sync.Once mechanism to ensure that the build information is initialized only once, thus avoiding the problem of concurrent initialization and ensuring thread safety.
Types ¶
type BuildInfo ¶
type BuildInfo struct { GitTag string `json:"git_tag,omitempty"` GitCommit string `json:"git_commit,omitempty"` GitBranch string `json:"git_branch,omitempty"` GitTreeState string `json:"git_tree_state,omitempty"` BuildDate string `json:"build_date,omitempty"` BuiltBy string `json:"built_by,omitempty"` GoVersion string `json:"go_version,omitempty"` Compiler string `json:"compiler,omitempty"` Platform string `json:"platform,omitempty"` Version string `json:"version,omitempty"` }
func ReadBuildInfo ¶ added in v0.0.92
func ReadBuildInfo() BuildInfo
ReadBuildInfo returns an instance of BuildInfo. This function ensures that the build information is initialized only once using sync.Once, which improves performance and ensures thread safety.
Returns:
- BuildInfo: A struct containing detailed build information.
Click to show internal directories.
Click to hide internal directories.