Last active
March 20, 2023 03:36
-
-
Save Mayankgupta688/7b431f828bcceadd310bd8ad9fe3e59e to your computer and use it in GitHub Desktop.
Return Multiple Values from Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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