productversion

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package productversion identifies the running product and compares stable releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(current Build, target string) string

Compare reports available, current, ahead, uncomparable, or no_candidate. Only explicitly marked releases with stable versions can be compared.

func StableVersion

func StableVersion(raw string) (string, bool)

StableVersion returns a canonical stable version with a leading v. It requires all three numeric components and ignores valid build metadata.

Types

type Build

type Build struct {
	Version string `json:"version"`
	Kind    string `json:"kind"`
}

Build describes a binary's version and whether it is a release or development build.

type Identity

type Identity struct {
	Edition        string `json:"edition"`
	InstallChannel string `json:"install_channel"`
	Build          Build  `json:"build"`
}

Identity is supplied by the executable or embedding host, never by configuration.

func ResolveIdentity

func ResolveIdentity(explicit *Identity, legacyVersion string) Identity

ResolveIdentity preserves explicit host identity and safely defaults legacy callers. Unknown identity values never promote a development build to a release.

Jump to

Keyboard shortcuts

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