Skip to content

Instantly share code, notes, and snippets.

@jochasinga
Created September 30, 2014 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jochasinga/40fc967e949960fedfb3 to your computer and use it in GitHub Desktop.
Save jochasinga/40fc967e949960fedfb3 to your computer and use it in GitHub Desktop.
Multiple return values in Go
package main
import "fmt"
func swap(a, b int) (int, int) {
_a := a
_b := b
a, b = _b, _a
return a, b
}
func main() {
fmt.Println(swap(1, 5))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment