Skip to content

Instantly share code, notes, and snippets.

@kjk
Last active July 20, 2020 03:34
Show Gist options
  • Save kjk/dd5d25485e5cccff6d1c8c10145a283c to your computer and use it in GitHub Desktop.
Save kjk/dd5d25485e5cccff6d1c8c10145a283c to your computer and use it in GitHub Desktop.
package main
import "fmt"
// :show start
func Add(a, b int) int {
return a + b
}
func AddAndMultiply(a, b int) (int, int) {
return a + b, a * b
}
func main() {
sum, mult := AddAndMultiply(5, 8)
fmt.Printf("5+8=%d\n5*8=%d\n", sum, mult)
sum = Add(6, 12)
fmt.Printf("6+12=%d\n", sum)
}
// :show end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment