version

package
v1.9.0-industry.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxLen is the max length of version string
	MaxLen = 100
)

Variables

This section is empty.

Functions

func Compare

func Compare(v1, v2 string) int

Compare compare v1 and v2, and return >0: v1 has higher version =0: equal <0: v2 has higher version

func CompareFunc

func CompareFunc(v1, v2 string, comp func(word1, word2 string) int) int

CompareFunc use custom func to compare two versions

func Parse

func Parse(str string) (ret []string, err error)

Parse passe version string and return string array. e.g.

1.0.1.201.build1

will return

[]string{"1", "0", "1", "201", "build", "1"}

The connector between version numbers can be "-"; "."; "+"; " "

Types

This section is empty.

Jump to

Keyboard shortcuts

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