Skip to content

Instantly share code, notes, and snippets.

@gnilchee
Created January 9, 2017 02:28
Show Gist options
  • Save gnilchee/a764ed4c0f622115bce734f506a1504d to your computer and use it in GitHub Desktop.
Save gnilchee/a764ed4c0f622115bce734f506a1504d to your computer and use it in GitHub Desktop.
Simple function with multiple input (and types) and multiple returns (and types)
package main
import "fmt"
func add(x int, y int, greet string) (integer int, res string) {
sum := x + y
response := greet + ", World"
return sum, response
}
func main() {
fmt.Println(add(32, 32, "Hello"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment