Q&A
Ask and answer questions to make information more available to wider audiences.
Jonathan Clinger @jonathancling72   06, Jun 2023 12:00 AM
return multiple values from a function
How to return multiple values from a function?
answers 1
 
Answer 1
Grace Jeanes @jeanesgrace   12, Jun 2023 05:25 PM
We can return multiple values from a function in Golang, the below code shows how we can return multiple values

package main

import “fmt”

func reverse(a,b string)(string, string)

{

return b,a

}

func main()

{

x,y:= reverse(“app”,”majix”)

fmt.println(x, y)

}