sdsemver

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sdsemver 语义化版本字符串工具

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParse = sderr.New("sdsemver parse version error")
)

Functions

func Compare

func Compare(a, b V) int

func Equal

func Equal(a, b V) bool

func ToInt

func ToInt(s string) (int64, error)

func ToString

func ToString(i int64) (string, error)

Types

type V

type V struct {
	Major int `json:"major"`
	Minor int `json:"minor"`
	Patch int `json:"patch"`
}

func FromInt

func FromInt(i int64) (V, error)

func New

func New(major, minor, patch int) V

func Parse

func Parse(s string) (V, error)

func (V) Equal

func (v V) Equal(major, minor, patch int) bool

func (V) IsEmpty

func (v V) IsEmpty() bool

func (V) IsValidate

func (v V) IsValidate() bool

func (V) String

func (v V) String() string

func (V) ToInt

func (v V) ToInt() int64

Jump to

Keyboard shortcuts

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