Override template ref to be any instead of interface{} #3474
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.
This fixes #3414 so that
ref
template functions used when generating will consistently useany
overinterface{}
. Linters, like revive, will flag the use ofinterface{}
and the recommendation is to usegofmt -w -r 'interface{} -> any'
to change them all toany
. This PR coerces the value to always preferany
, which is a dirty hack that will probably bite me. I am not sure why the behavior is inconsistent without this change. I think somehow the template is supplied with$type.GO
inconsistently (despite my puttingtypes.Unalias
seemingly all over the place in other PRs). If someone has a better idea, I would love to hear about it.$type.GO
toref
hereref
function hereCurrentImports.LookupType
heres.Lookup(i.Path()
that is implemented hereSigned-off-by: Steve Coffman steve@khanacademy.org