1234567891011121314151617 |
- // Functions can return multiple results
- package examples
- import "fmt"
- // This function returns two strings
- func swap(x, y string) (string, string) {
- return y, x
- }
- func Multipleres() (string, string) {
- a, b := swap(" Language!", "Go")
- fmt.Printf("%s%s\n", a, b)
- return a, b
- }
|