Golang in sixty seconds — function basics
2 min readAug 4, 2022
In any programming language a function can often be thought of as a black box that will perform an action. They can take inputs and return outputs, but they don’t have to do either. They’re most often used to separate code to aid readability and understanding, and to avoid repetition.
In Go, a function looks like this:
func add(num1 int, num2 int) int {
return num1…