hashicorp / hashicorp/go-version

Prerelease String shouldn't always be treated as lower version

Open
#102 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
1.8k
Forks
165
Avg merge
23h 42m
Merged PRs (30d)
2

Description

Hey,
I've found some irregularity where I have the following two versions for tcpdump
`4.9.3-4ubuntu0.1`
`4.9.3`

Using the example code from the readme we get that `4.9.3` is greater than `4.9.3-4ubuntu0.1` even though that's not the case
[Link to playground](https://go.dev/play/p/lYLfj29avfs) to see my tests.

I'm pretty sure that `4ubuntu0.1` doesn't mean it's a prerelease version and it's a widely used suffix.
In other compiled binaries for ubuntu.

I'm not sure what's the correct approach to solve this, but I was wondering whether we should narrow down the behavior when evaluating the prerelease string.
WDYT?

Contributor guide

Open the contributing guide

Research direction

Start with the README example and the linked Go playground to reproduce the comparison between 4.9.3-4ubuntu0.1 and 4.9.3. Determine the intended handling of the Ubuntu suffix, then add coverage for the reported ordering and confirm the version comparison behaves accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.