feat: ignore go build constraints - #22
Merged
marwan-at-work merged 1 commit intoSep 21, 2023
Merged
Conversation
pascal-hofmann
marked this pull request as draft
September 20, 2023 09:28
BREAKING CHANGE: mod will now ignore go build constraints and upgrade/downgrade
Semantic Import Versioning in all .go files.
The flag `buildflags` has been removed.
pascal-hofmann
marked this pull request as ready for review
September 20, 2023 09:46
Contributor
Author
|
@marwan-at-work It would be great to get this merged soon. We have some pending major upgrades in multiple projects that |
Contributor
Author
|
@marwan-at-work Awesome - thanks for the quick merge! Can you create a new github release? |
Contributor
Author
|
@marwan-at-work Any chance to get a new release with this? This would help us a lot with some tedious pending upgrades that renovate could do instead of us doing it manually. |
Contributor
Author
|
@marwan-at-work Any update on creating a new release? Is this blocked by something or do you need help with this? |
Owner
|
@pascal-hofmann apologies for the delay, here's the release https://github.com/marwan-at-work/mod/releases/tag/v0.6.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
first of all: thanks for this great tool! (I'm using it as part of https://github.com/renovatebot/renovate.)
I noticed that
moddoes not ignore build constraints when upgrading/downgrading Semantic Import Versioning.This PR will change
mod, so it will ignore go build constraints and upgrade/downgrade Semantic Import Versioning in all.gofiles. The flagbuildflagshas been removed, as it makes no sense anymore.There does not seem to be a way to get the golang.org/x/tools/go/packages to ignore build constraints, so I now only use it to get information about all packages and their
GoFilesplus theIgnoredFiles(source files that are not part of the package using the current build configuration but that might be part of the package using other build configurations).These files are then parsed using go/parser. Apart from this, the update logic has not changed.
Cheers
Pascal
PS: I also replaced the deprecated call to
ioutil.WriteFile(…)withos.WriteFile(…).