Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
distro: add new 'ID.Version()` method
This commit adds a new method `ID.Version()` that returns a `go-version.Version` object so that we can easily sort the distro versions. The `ID.Version()` currently also has to return an error because the ID struct exposes MajorVersion/MinorVersion which means that during the lifetime the Version may become invalid even after `ParseID` was run. We could fix this by making {Major,Minor}Version getters instead of the current way. Then we could also use the version.NewVersion() library directy to parse the version string from the ID and support things like `-beta` or other extras that semantic versioning allows. But then that may interfere with the distroid.Parser interface so definitely needs some more thinking.
- Loading branch information