Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created July 15, 2022 19:43
Show Gist options
  • Save nwillc/e94da153d92abc98f1cdf56906b26c03 to your computer and use it in GitHub Desktop.
Save nwillc/e94da153d92abc98f1cdf56906b26c03 to your computer and use it in GitHub Desktop.
Go multiple return assignments
rotate := func(a, b, c int) (int, int, int) {
return b, c, a
}
aa, bb, cc := rotate(1, 2, 3)
fmt.Println(aa, bb, cc)
// output: 2 3 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment