version

package
v0.0.0-...-870f2d0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 1 Imported by: 4

README

Go Reference

golang.org/x/build/maintner/maintnerd/maintapi/version

Package version implements logic to parse version of Go tags and release branches.

Documentation

Overview

Package version implements logic to parse version of Go tags and release branches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go1PointX

func Go1PointX(version string) (int, bool)

Go1PointX returns the second number in a string that looks like a Go version, i.e. X in anything that starts with "go1.X".

func ParseReleaseBranch

func ParseReleaseBranch(branchName string) (major, minor int, ok bool)

ParseReleaseBranch parses the major-minor version pair from release-branch.goX or release-branch.goX.Y release branch names, and reports whether the release branch name is valid.

For example, "release-branch.go1" is parsed as version 1.0, and "release-branch.go1.2" is parsed as version 1.2.

func ParseTag

func ParseTag(tagName string) (major, minor, patch int, ok bool)

ParseTag parses the major-minor-patch version triplet from goX, goX.Y, or goX.Y.Z tag names, and reports whether the tag name is valid.

Tags with suffixes like "go1.2beta3" or "go1.2rc1" are currently not supported, and get rejected.

For example, "go1" is parsed as version 1.0.0, "go1.2" is parsed as version 1.2.0, and "go1.2.3" is parsed as version 1.2.3.

Types

This section is empty.

Jump to

Keyboard shortcuts

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