version

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 7 Imported by: 1 module, 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 provides utilities for handling version information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() v1version.Info

Get returns the version information. When the binary is built without goreleaser ldflags (e.g. go install, go build), it falls back to VCS info embedded by the Go toolchain via debug.ReadBuildInfo.

Types

type Version

type Version struct {
	// contains filtered or unexported fields
}

Version is an opaque representation of a version number.

func ParseSemantic

func ParseSemantic(str string) (*Version, error)

ParseSemantic parses a semantic version string and returns a Version object. It's from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-base/version/dynamic.go

func (*Version) Major

func (v *Version) Major() uint

Major returns the major version component.

func (*Version) Minor

func (v *Version) Minor() uint

Minor returns the minor version component.

func (*Version) Patch

func (v *Version) Patch() uint

Patch returns the patch version component.

Jump to

Keyboard shortcuts

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