In Go, we can define functions that take a variable number of arguments, by defining a "rest" argument. When calling such a function, one can pass the elements of a slice as the "variadic" arguments with the ...
syntax, as in:
elems := []string{"usr", "local", "bin"}
p := filepath.Join(elems...)
However, this only works if the slice:
- lines up exactly with the "rest" argument