Documentation
¶
Overview ¶
Package output handles version formatting, promotion, and serialization.
Index ¶
- func FormatExplanation(result calculator.VersionResult) string
- func GetVariables(ver semver.SemanticVersion, ec config.EffectiveConfiguration) map[string]string
- func PromoteCommitsToPreRelease(ver semver.SemanticVersion, mode semver.VersioningMode, fallbackTag string) semver.SemanticVersion
- func WriteAll(w io.Writer, variables map[string]string) error
- func WriteExplanation(w io.Writer, result calculator.VersionResult) error
- func WriteJSON(w io.Writer, variables map[string]string) error
- func WriteVariable(w io.Writer, variables map[string]string, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatExplanation ¶
func FormatExplanation(result calculator.VersionResult) string
FormatExplanation returns the explain output as a string.
func GetVariables ¶
func GetVariables( ver semver.SemanticVersion, ec config.EffectiveConfiguration, ) map[string]string
GetVariables computes all output variables for a version, applying mode-specific transformations (ContinuousDeployment promotion) and then computing format values.
func PromoteCommitsToPreRelease ¶
func PromoteCommitsToPreRelease( ver semver.SemanticVersion, mode semver.VersioningMode, fallbackTag string, ) semver.SemanticVersion
PromoteCommitsToPreRelease transforms a version for ContinuousDeployment or Mainline modes by setting CommitsSinceTag as the pre-release number. This is a pure function — no side effects.
In ContinuousDeployment mode, commit count becomes the pre-release number:
1.2.0+5 → 1.2.0-ci.5 (using fallback tag "ci")
In ContinuousDelivery mode, the version is returned unchanged.
func WriteExplanation ¶
func WriteExplanation(w io.Writer, result calculator.VersionResult) error
WriteExplanation writes a structured explain output for the version calculation to w. It shows all strategy candidates, the selected winner, increment reasoning, pre-release tag resolution, and the final result.
Types ¶
This section is empty.