I'm following this tutorial, specifically exercise 8:
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)
}
Specifically what does the :=
mean? Searching for Go documentation is very hard, ironically.
go := meaning
,golang :=
and nothing relevant came up. – Sticklea
andb
, both of typestring
, initialized with the values returned fromswap("hello", "world")
– Nkrumah