version

package
v0.0.0-...-d3be009 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: BSD-3-Clause, CC-BY-4.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version provides shared utilities for manipulating Go semantic versions with no prefix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Before

func Before(v, v2 string) bool

Before reports whether v < v2, where v and v2 are unprefixed semantic versions.

func Canonical

func Canonical(v string) string

Canonical returns the canonical, unprefixed form of the version v, which should be an unprefixed semantic version. Unlike semver.Canonical, this function preserves build tags.

func IsCommitHash

func IsCommitHash(v string) bool

func IsValid

func IsValid(v string) bool

IsValid reports whether v is a valid unprefixed semantic version.

func Major

func Major(v string) string

Major returns the major version (e.g. "v2") of the unprefixed semantic version v.

func SemverToGoTag

func SemverToGoTag(v string) (string, error)

SemverToGoTag returns the Go standard library repository tag for the given unprefixed semver version. Go tags differ from standard semantic versions in a few ways, such as beginning with "go" instead of "v".

func TrimPrefix

func TrimPrefix(v string) string

TrimPrefix removes the 'v' or 'go' prefix from the given semantic version v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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