@kjk1/

gobook function returned values

Go

No description

fork
loading
Files
  • main.go

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.050951568918041534","path":"main.go","file":{"path":"main.go","content":{"asEncoding":{"base64":"cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCi8vIDpzaG93IHN0YXJ0CmZ1bmMgQWRkKGEsIGIgaW50KSBpbnQgewoJcmV0dXJuIGEgKyBiCn0KCmZ1bmMgQWRkQW5kTXVsdGlwbHkoYSwgYiBpbnQpIChpbnQsIGludCkgewoJcmV0dXJuIGEgKyBiLCBhICogYgp9CgpmdW5jIG1haW4oKSB7CglzdW0sIG11bHQgOj0gQWRkQW5kTXVsdGlwbHkoNSwgOCkKCWZtdC5QcmludGYoIjUrOD0lZCwgNSo4PSVkXG4iLCBzdW0sIG11bHQpCglzdW0gPSBBZGQoNiwgMTIpCglmbXQuUHJpbnRmKCI2KzEyPSVkXG4iLCBzdW0pCn0KCi8vIDpzaG93IGVuZA=="},"asBuffer":null},"loaded":true}}
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