Your function is declared to return only a single string, and the "return" statement returns immediately from the function with that single string, so this is what you've coded it to do.
If you want to return multiple values, then (1) you'll have to declare the function to return a slice of strings, and (2) you'll need to build up that slice, and return it at the end. On Friday, 12 November 2021 at 17:20:10 UTC bishwajits...@gmail.com wrote: > HI, need help in understanding what i am making mistake of not able to > return all the values. Below is the sample code from Playground. > https://play.golang.org/p/EMN830T0Lvr > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/48bcd799-d6b9-4b61-8d60-84a587fd855bn%40googlegroups.com.