golang/go

x/tools/go/analysis/passes/inline: skip inlining in the primary tests of the annotated function

Closed this issue · 2 comments

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.

Change https://go.dev/cl/718185 mentions this issue: go/analysis/passes/inline: skip on dedicated test of target func