x/tools/go/analysis/passes/inline: skip inlining in the primary tests of the annotated function
Closed this issue · 2 comments
adonovan commented
The inline analyzer inlines calls to functions annotated with a //go:fix inline directive. This is usually desirable in tests as well as production code; however, it is not wanted in the specific tests of the annotated function itself.
The analyzer should use a heuristic to recognize this case and skip it.
gabyhelp commented
Related Issues
- cmd/compile: add //go:noinline annotation support #12140 (closed)
- x/tools/go/analysis/passes/inline: publish //go:fix inline analyzer #75267 (closed)
- x/tools/internal/refactor/inline: unnecessary (&y).f after inlining function containing x.f() call to method declared as (*T).f #69442 (closed)
- x/tools/internal/refactor/inline: analyzer generates unnecessary import renames #67281 (closed)
Related Code Changes
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
gopherbot commented
Change https://go.dev/cl/718185 mentions this issue: go/analysis/passes/inline: skip on dedicated test of target func