I’m kinda new to Go (actually started yesterday) and I couldn’t get why these are giving me error
func first_char(s string) (string,string,string){
var chars = strings.Split(s," ")
return chars[0][0], chars[1][0]
}
I’m kinda new to Go (actually started yesterday) and I couldn’t get why these are giving me error
func first_char(s string) (string,string,string){
var chars = strings.Split(s," ")
return chars[0][0], chars[1][0]
}
in golang is possible to pass a multi-value returning function call to a variadic parameter only if you don’t specify the format. So for example fmt.Println(getInitials("lets go")
will work.
See Spec: Calls
Thanks a lot for help!