Which of the following is true about variadic functions in Go?

  • They can accept a variable number of arguments
  • They can only accept a fixed number of arguments
  • They can only return a single value
  • They cannot be called with arguments
Variadic functions in Go are functions that can accept a variable number of arguments. This is achieved by specifying the type of the last parameter as ...type, where type is the type of the arguments. Within the function, the variable behaves like a slice containing all the arguments passed in.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *