Closed quki3 closed 2 months ago
Context: https://go.dev/tour/basics/6
package main
import "fmt"
func swap(x, y string) (string, string) { return y, x }
func main() { a, b := swap("hello", "world") fmt.Println(a, b) }
output // world hello WHAT DO I EXPECT? ouput // hello word
The two strings were swapped, the output is correct.
Context: https://go.dev/tour/basics/6
package main
import "fmt"
func swap(x, y string) (string, string) { return y, x }
func main() { a, b := swap("hello", "world") fmt.Println(a, b) }
output // world hello WHAT DO I EXPECT? ouput // hello word