Created
July 15, 2022 19:43
-
-
Save nwillc/e94da153d92abc98f1cdf56906b26c03 to your computer and use it in GitHub Desktop.
Go multiple return assignments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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