What does “i.(string)” actually mean in golang syntax? [duplicate]
问题 This question already has answers here : Is this casting in golang? (1 answer) What is the meaning of “dot parenthesis” syntax in Golang? (1 answer) Closed 2 years ago . I recently started looking for functional go examples and I found this function: mapper := func (i interface{}) interface{} { return strings.ToUpper(i.(string)) } Map(mapper, New(“milu”, “rantanplan”)) //[“MILU”, “RANTANPLAN”] Now in this function, as you can see the return value of mapper is: strings.ToUpper(i.(string)) .