Files
  • main.go
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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, 5*8=%d\n", sum, mult)
	sum = Add(6, 12)
	fmt.Printf("6+12=%d\n", sum)
}

// :show end
go version go1.9.4 linux/amd64