What is the meaning of “…Type” in Go?

后端 未结 1 1177
闹比i
闹比i 2021-01-11 18:13

This code is in builti.go:

// The append built-in function appends elements to the end of a slice. If
// it has sufficient capacity, the destina         


        
相关标签:
1条回答
  • 2021-01-11 18:35

    The code in builtin.go serves as documentation. The code is not compiled.

    The ... specifies that the final parameter of the function is variadic. Variadic functions are documented in the Go Language specification. In short, variadic functions can be called with any number of arguments for the final parameter.

    The Type part is a stand-in for any Go type.

    0 讨论(0)
提交回复
热议问题