meta

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package meta holds build-time metadata for the anfra binary.

Index

Constants

This section is empty.

Variables

View Source
var Version = ""

Version is the anfra version this binary is.

A release injects it at build time, as the `version` from manifest.yml (the single source of truth, which also names the `v<version>` tag):

go build -ldflags "-X github.com/holistics/anfra/internal/meta.Version=0.4.3"

Built into another program, which imports anfra as a module (anfra-cloud's server, say), it is the version of anfra that program pins, as Go records it in the binary: a release, 0.4.3, or an unreleased commit's pseudo-version, 0.4.4-0.20260722101500-f4fb35812ab3. Nothing is injected there: the program's build sets its own version, not anfra's.

Any other build is one from source, and says which: the release it comes after (base), then, as semver build metadata, the commit it was built from and whether the tree had uncommitted changes, as Go records them in the binary: 0.4.3+f4fb358, or 0.4.3+f4fb358.dirty. Build metadata leaves the order alone, so such a build sorts with the release it comes after; and a release never carries any, so its presence alone tells a build from source (FromSource).

Functions

func FromSource

func FromSource() bool

FromSource reports whether this binary was built from source rather than released: its version carries build metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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