Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Last active March 20, 2023 03:36
Show Gist options
  • Save Mayankgupta688/7b431f828bcceadd310bd8ad9fe3e59e to your computer and use it in GitHub Desktop.
Save Mayankgupta688/7b431f828bcceadd310bd8ad9fe3e59e to your computer and use it in GitHub Desktop.
Return Multiple Values from Function
package main
import "fmt"
func main() {
variableOne, variableTwo := getValues()
fmt.Println("Value for variable one is:", variableOne)
fmt.Println("Value for variable two is:", variableTwo)
}
func getValues() (int, int) {
return 10, 20
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment