Skip to content

Add SemVer constraint wrapper and add framework test files #377

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 27, 2025

Conversation

terrorbyte
Copy link
Collaborator

Continuing my efforts to speed up some of the dev experience and cut the (go)ilerplate down, this adds a Masterminds SemVer constraint wrapper. We use this all the time for version checking internally and it's about time that it gets wrapped into something useful. I always hesitate to add a dependency, but it has become nearly universal and I think justifies itself.

Usage is simple:

if !exploit.CheckSemVer(version, "<= 1.0.0") {
	output.PrintError("Version did not match the constraint")

        return false
}

@terrorbyte terrorbyte requested review from wvu and j-baines May 16, 2025 22:03
@terrorbyte terrorbyte self-assigned this May 16, 2025
@terrorbyte terrorbyte added enhancement New feature or request go Pull requests that update go code labels May 16, 2025
@j-baines j-baines merged commit 5481ac2 into main May 27, 2025
7 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request go Pull requests that update go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants