Fundamentals2 / 10
Up next

Functions

package main

import "fmt"

// parameters share a type; the return type follows the list
func add(a, b int) int {
	return a + b
}

func main() {
	fmt.Println(add(2, 3))
}
What you're solving

typed parameters and a return type