Golang in sixty seconds — function basics

Photo by charlesdeluvio on Unsplash

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…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Richard Bell

Richard Bell

445 Followers

Father to a beautiful baby girl | Husband to a generous wife | Lead Software Engineer | Hobby collector | Support me at ko-fi.com/richardtbell