Categorygithub.com/masahiro331/go-mvn-version
modulepackage
0.0.0-20250131095131-f4974fa13b8a
Repository: https://github.com/masahiro331/go-mvn-version.git
Documentation: pkg.go.dev

# README

go-mvn-version

A Go library for parsing maven(java) package versions

go-mvn-version is a library for parsing and comparing versions

The implementation is based on this specification

other reference: maven implementation

Installation and Usage

Installation can be done with a normal go get:

$ go get github.com/masahiro331/go-mvn-version

Version Parsing and Comparison

import "github.com/masahiro331/go-mvn-version"

v1, err := version.NewVersion("10-snapshot")
v2, err := version.NewVersion("10-b1")

if v1.GreaterThan(*v2) {
    fmt.Printf("%s is greater than %s", v1, v2)
}

WARNING

This implementation based on the maven specification, but not the maven implementation.

See issues: ComparableVersion incorrectly parses certain version strings

$ go test .
--- FAIL: TestVersionsNumber (0.00s)
    version_test.go:415: expected: 2.0.a < 2.0.0.a
    version_test.go:418: expected: 2.0.0.a > 2.0.a
FAIL
FAIL    github.com/masahiro331/go-mvn-version/pkg/version       0.005s
FAIL

License

Apache License 2.0

Author

Masahiro Fujimura

# Functions

No description provided by the author
No description provided by the author
NewRequirements is return Requirement [1.0.0], [1.0.1] => []requirement{"[1.0.0]","[1.0.1]"} [1.0.0] => []requirement{"[1.0.0]"}.
No description provided by the author

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Constraints is one or more constraint that a version can be checked against.
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author