version

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package version classifies version strings into the schemes semver, calver, date, pseudo and unknown. The raw string is always kept; an unknown scheme is never dropped. See https://cernly.dev/how/facts/.

Index

Constants

View Source
const (
	SemVer  = "semver"
	CalVer  = "calver"
	Date    = "date"
	Pseudo  = "pseudo"
	Unknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Raw        string
	Scheme     string
	Normalised string
}

func Parse

func Parse(raw string) Version

Parse classifies raw. Partial numeric versions (17, 3.21) are semver with the precision as written: 17 is not 17.0.0.

func Tag

func Tag(tag string) Version

Tag reads an image tag: the version part before a variant suffix (17-alpine -> 17), or the whole tag for date forms. Raw stays the tag.

func (Version) Attrs

func (v Version) Attrs() map[string]any

Attrs returns the version def of scan.v1.schema.json.

Jump to

Keyboard shortcuts

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