more examples
This commit is contained in:
19
gobyexample/functions.go
Normal file
19
gobyexample/functions.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func plus(a int, b int) int {
|
||||
return a+b
|
||||
}
|
||||
|
||||
func plusPlus(a, b, c int) int {
|
||||
return a + b + c
|
||||
}
|
||||
|
||||
func main() {
|
||||
res := plus(1, 2)
|
||||
fmt.Println("1+2 =", res)
|
||||
|
||||
res = plusPlus(1, 2, 3)
|
||||
fmt.Println("1+2+3 =", res)
|
||||
}
|
Reference in New Issue
Block a user