You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The built-in function make takes a type T, which must be a slice, map or channel type, optionally followed by a type-specific list of expressions."
This appears to exclude named types, even though make will create values of named types.
Maybe: "The built-in function make takes a type T, whose underlying type must be a slice, map or channel type, optionally followed by a type-specific list of expressions."
I also think the current text is fine. Something like "[]int" is a type literal. Saying "slice type" includes not just type literals but also named slice types.
https://golang.org/ref/spec#Making_slices_maps_and_channels
"The built-in function make takes a type T, which must be a slice, map or channel type, optionally followed by a type-specific list of expressions."
This appears to exclude named types, even though make will create values of named types.
Maybe: "The built-in function make takes a type T, whose underlying type must be a slice, map or channel type, optionally followed by a type-specific list of expressions."
Here's some working code that I think is not covered by the current spec: http://play.golang.org/p/mekr0KLDWj
package main
import "fmt"
type T []int
func main() {
fmt.Println(make(T, 10))
}
The text was updated successfully, but these errors were encountered: