Source file tour/basics/multiple-results.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  func swap(x, y string) (string, string) {
     8  	return y, x
     9  }
    10  
    11  func main() {
    12  	a, b := swap("hello", "world")
    13  	fmt.Println(a, b)
    14  }
    15  

View as plain text