version

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package version reads grelot's version strings: the one a build reports, the one it sends and answers as Grelot-Version, and their order.

Index

Constants

View Source
const Dev = "dev"

Dev is the version of a build that carries no release version. Every server speaks it, and no skew line compares it.

Variables

This section is empty.

Functions

func Build

func Build(stamp string, read func() (*debug.BuildInfo, bool)) string

Build is the version a binary reports: stamp, the -X main.version a release build carries, unless it is empty or Dev; else the main module's version from read, as go version -m shows it (a tag, a -dev.N tag, a pseudo-version, a +dirty checkout); else Dev.

func Wire

func Wire(build string) string

Wire is the Grelot-Version of a build of version build: build when Parse reads it, else Dev, since a server answers any other client version with a 426.

Types

type V

type V struct {
	Release [3]int
	// Dev is N of a -dev.N build, -1 for a release.
	Dev int
}

V is a parsed vX.Y.Z or vX.Y.Z-dev.N.

func Parse

func Parse(s string) (V, bool)

Parse reads s as vX.Y.Z or vX.Y.Z-dev.N, each number of at most 9 digits with no leading zero. Anything else, Dev and a pseudo-version included, is not a version.

Jump to

Keyboard shortcuts

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