Created
October 17, 2018 17:35
-
-
Save guitarrapc/e39df708d99abf3619fc73becbf714c2 to your computer and use it in GitHub Desktop.
Deconstruct and pass inline.
This file contains 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
package main | |
import "fmt" | |
func pair(x int) (int, int) { | |
return x, x + 1 | |
} | |
func add(x int, y int) int { | |
return x + y | |
} | |
func main() { | |
fmt.Println(add(pair(10))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment