Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix bug in tag prefix trimming #12

Merged
merged 1 commit into from
Nov 17, 2022
Merged

Conversation

alangibson01
Copy link
Contributor

The tag prefix trimming was using strings.TrimLeft, which gave an incorrect result if the tag prefix happened to contain a digit that was also in the version number.

For example: myapp1-1.0.0 would be trimmed to .0.0 rather than 1.0.0.

The correct function to use in this case is strings.TrimPrefix.

Fixes #9

@chuckydev
Copy link
Collaborator

This looks good to me @alangibson01 . In order to get the release working you will need to prefix your commit with [vergo:(major|minor|patch)-release]

The tag prefix trimming was using `strings.TrimLeft`, which gave an incorrect
result if the tag prefix happened to contain a digit that was also in the
version number.

For example: `myapp1-1.0.0` would be trimmed to `.0.0` rather than `1.0.0`.

The correct function to use in this case is `strings.TrimPrefix`.
@alangibson01
Copy link
Contributor Author

@chuckydev Amended. Thanks for spotting that!

@alangibson01 alangibson01 merged commit 49aded0 into master Nov 17, 2022
@alangibson01 alangibson01 deleted the fix-prefix-trimming-bug branch November 17, 2022 14:57
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.

Add option to handle suffix
2 participants