In order to understand the first set of tests, we need to understand what a variadic function is and how Go handles it. Let's start with the definition:
Given that Go is a statically typed language, the only limitation imposed by the type system on a variadic function is that the indefinite number of arguments passed to it should be of the same data type. However, this does not limit us from passing other variable types. The arguments are received by the function as a slice of elements if arguments are passed, else nil, when none are passed.
Let's look at the code to get a better idea:
// variadic.go package main func simpleVariadicToSlice(numbers ...