semver

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVersion = errors.Base("invalid version")
)

Functions

This section is empty.

Types

type SemVer

type SemVer struct {
	Major  int    // Major version number.
	Minor  int    // Minor version number.
	Patch  int    // Patch number.
	Commit string // VCS commit identifier.
}

Semantic version structure.

func MakeSemVer

func MakeSemVer(info string) (*SemVer, error)

Make a new semantic version from the given string.

func NewSemVer

func NewSemVer() *SemVer

Create a new empty semantic version object.

func (*SemVer) FromString

func (s *SemVer) FromString(info string) error

Convert numeric version to components.

func (*SemVer) String

func (s *SemVer) String() string

Return a string representation of the semantic version.

func (*SemVer) Version

func (s *SemVer) Version() int

Return an integer version.

Jump to

Keyboard shortcuts

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