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
The former used an unnecessary anonymous function that could instead directly used the method expression.
This is rewrite is relatively trivial to statically detect where you have function of N input arguments and M output arguments and the body includes a single return expression calling a method on the first argument with N-1 input arguments.
I considered filing this in the golang/go issue tracker as a go/vet finding, but it's not a correctness bug, but rather a cleanliness "bug" that might be suited for staticcheck (where "simplicity" is listed one of the goals).
Activity
dominikh commentedon Oct 7, 2025
Related: #123