Skip to main content

Module buildinfo

Module buildinfo 

Source
Expand description

Build-time version information, for caproni version’s output.

Ported from internal/buildinfo/buildinfo.go. Go injects version, commit, and date via goreleaser’s -ldflags, defaulting to "dev"/"unknown"/"unknown" in a plain go build. This port uses env!("CARGO_PKG_VERSION") for version() (always accurate; Cargo always knows it, unlike Go’s zero-value default), and option_env! for commit()/date(), which a release build sets via XIANYUN_BUILD_COMMIT/ XIANYUN_BUILD_DATE environment variables at compile time, falling back to the same "unknown" Go defaults to otherwise.

Functions§

commit
Returns the git commit hash.
date
Returns the build date.
version
Returns the build version.