Passing arguments to ... parameters Language Specification

Passing arguments to ... parameters
If f is variadic with a final parameter p of type ...T,

What does it mean by “final” parameter?

Final as in “last”.

A prominent function that is variadic (accepts a variable number of arguments) is fmt.Printf() which looks like this:

func Printf(format string, a ...interface{}) (n int, err error)

The ellipsis notation is only ever available for the last/final argument in the argumentlist.

1 Like

What is an argumentlist? Self explanatory?

Another question…sorry, I forgot to put them together.

If f is invoked 

Are “invoked” and “called” synonymous?

In “func factorial(n int) int {
if n == 0 {
return 1
}
return n *”
What are the parameters?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.