Yes, the form for eliding individual names requires and explicit _
func (_ int, y int) int
However, normally the names are left in the signature, even if unused,
for the purposes of documentation.
negative: this compiles perfectly well:
func f(int, _ int, i int) {}
Sure, and so does this:
func f(int, _ int, i int) int {
return int
}
While this does not:
func f(int, _ int, i int) int {
var a int
return a
}
You didn't elide the first parameter name, you just named your first
parameter 'int' :).
(Which makes it unavailable as a type name inside the body of that function)
Note that the spec says you either name *all* of your parameters or
*none* of them.
I believe that will give you a parameter named "int", which is probably
not what you want.
Ian
I think you just misunderstood.
> func f(int, _ int, i int) {}
This is no different than
func(x, y int, z int) {}
except for the names of the parameters.
It has been that way since we launched Go.
Russ