Skip to content

fix: validate and preprocess version in FindSemVerInfo#139

Merged
yxxhero merged 1 commit into
masterfrom
fix--validate-and-preprocess-version-in-FindSemVerInfo
Aug 14, 2025
Merged

fix: validate and preprocess version in FindSemVerInfo#139
yxxhero merged 1 commit into
masterfrom
fix--validate-and-preprocess-version-in-FindSemVerInfo

Conversation

@yxxhero
Copy link
Copy Markdown
Member

@yxxhero yxxhero commented Aug 14, 2025

This pull request improves the robustness and usability of the FindSemVerInfo utility function by handling empty and non-prefixed version strings, and updates the related tests to reflect the new behavior.

Enhancements to version string handling:

  • Updated FindSemVerInfo in util.go to return an error if the input version string is empty and to automatically add a v prefix if it's missing before extracting the semantic version.

Test updates:

  • Modified the test case in util_test.go to expect a valid semver result when the version string does not start with v, reflecting the new logic in FindSemVerInfo.

Signed-off-by: yxxhero <aiopsclub@163.com>
@yxxhero yxxhero merged commit 79db4e1 into master Aug 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant