blang / semver

Semantic Versioning (semver) library written in golang
MIT License
1.01k stars 101 forks source link

Not equal expression with wildcards `!=1.0.x` checks failure #80

Open ByteF1sh opened 3 weeks ago

ByteF1sh commented 3 weeks ago

hi, i want to exclude all the versions in 1.1.x and set a range like this "!=1.1.x",but all the versions are checked failure. Here's the test code.

import (
    "github.com/blang/semver/v4"
    "testing"
)

func TestV(t *testing.T) {
    versionRange := "!=1.0.x"
    expectedRange, err := semver.ParseRange(versionRange)
    if err != nil { //wrong range exp
        t.Fail()
    }
    v, _ := semver.Parse("1.1.1")
    if !expectedRange(v) { // expectedRange(v) == false,want true but got false
        t.Fail()
    }
}

I noticed that this range will expand to <1.1.0 and >=1.2.0 ,and it should link with OR but not AND . Is there any plan to fix it ?

mamachanko commented 3 weeks ago

This repository is unmaintained. I think your options are to fork+fix or use another module like masterminds/semver. Alternatively, you may get some response on the fork of blang/semver we maintain in carvel-dev/semver.

ByteF1sh commented 3 weeks ago

This repository is unmaintained. I think your options are to fork+fix or use another module like masterminds/semver. Alternatively, you may get some response on the fork of blang/semver we maintain in carvel-dev/semver.

it works,thx a lot