You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Go 1.18 was released with support for Generics, we had go to extreme lengths in the extractor to get some information. A much easier way to get that information was added in Go 1.19 in the form of the Origin() method on *types.Var and *types.Func. This PR uses those methods in the extractor.
Suggest manually verifying if this works when the environmental Go is 1.17, since there's a risk packages.Load is getting some of this data from invoking go to dump the AST. It certainly uses the environmental Go for go list; unsure if it uses it for AST / type information, so it'd be good to be sure if we're effectively dropping 1.17 compatibility because that compiler might not provide the origin member. Otherwise LGTM.
@smowton I checked out this branch, ran make in go to build the extractor, uninstalled go and installed go 1.17, confirmed that was the only version of go installed, then ran all the tests. No problems extracting. A handful of tests failed but they were related to things missing from the libraries.
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
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.
When Go 1.18 was released with support for Generics, we had go to extreme lengths in the extractor to get some information. A much easier way to get that information was added in Go 1.19 in the form of the
Origin()method on*types.Varand*types.Func. This PR uses those methods in the extractor.