These both work:
m := make(map[int]int)
elem, ok := m[1]
elem = m[1]
Yet, this not allowed:
func overload() (int, int) {
return 1, 1
}
func overload() int {
return 1
}
func main() {
x := overload()
x, y := overload()
}
Also, is there a list of built-in syntax that doesn't generalize? I keep getting confused on what is a special syntax, i.e. map[string]int
, make([]int, 10)
and what is part of the language.