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
We should integrate our keyify tool with gopls, and deprecate/remove the command-line tool. gopls comes with a check for unkeyed composite literals in golang.org/x/tools/go/analysis/passes/composite/composite.go, and we could improve that one to offer a suggested fix.
We would also like to offer keyification for struct literals that aren't flagged by the composite pass (because the type and its instantiation occur in the same package). This would tie into our planned set of quickfix checks.
Before we can do this, we should probably fix #185 first. We also need to figure out where the keyification logic should live.
If it lives only in our repository, then an analysis pass in x/tools would have to depend on us.
If it lives only in x/tools, then it would have to be exported so that we can reuse it in quickfix.
The code may be straightforward enough to copy into both projects.
If it lives only in our repository, then an analysis pass in x/tools would have to depend on us.
That's fine for us! We can do the usual deduplication logic and prefer the staticcheck version of the analysis. Also totally fine to put it in x/tools and put the suggested fix in the existing analysis. I don't really have a strong preference either way.
We should integrate our
keyify
tool with gopls, and deprecate/remove the command-line tool. gopls comes with a check for unkeyed composite literals ingolang.org/x/tools/go/analysis/passes/composite/composite.go
, and we could improve that one to offer a suggested fix.We would also like to offer keyification for struct literals that aren't flagged by the
composite
pass (because the type and its instantiation occur in the same package). This would tie into our planned set ofquickfix
checks.Before we can do this, we should probably fix #185 first. We also need to figure out where the keyification logic should live.
quickfix
./cc @stamblerre in case she has any input.
The text was updated successfully, but these errors were encountered: