Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created October 17, 2018 17:35
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 guitarrapc/e39df708d99abf3619fc73becbf714c2 to your computer and use it in GitHub Desktop.
Save guitarrapc/e39df708d99abf3619fc73becbf714c2 to your computer and use it in GitHub Desktop.
Deconstruct and pass inline.
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