version

package
v0.0.0-...-f553ac0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	Major int
	Minor int
	Patch int
	Label string
}

Version represents a semantic version number.

func MustParse

func MustParse(s string) Version

MustParse is like Parse, but panics if s cannot be parsed.

func Parse

func Parse(s string) (Version, error)

Parse parses a semantic version number from string s.

func (Version) Compare

func (v1 Version) Compare(v2 Version) int

Compare returns a positive integer if v1 is greater than v2, a negative integer if v1 is less than v2 and zero if they are equal.

func (Version) IsZero

func (v Version) IsZero() bool

IsZero returns whether v is the zero version, 0.0.0.

func (Version) Less

func (v1 Version) Less(v2 Version) bool

Less returns true if v1 is lower than v2.

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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