Functions and Scopes

Understand the scope of variables and learn to create functions in Go.

We'll cover the following

Scopes

A scope is a program region where we can access a variable. We have local and global variables in Go. We can access local variables within the blocks we define them in. Global variables are accessible throughout the program.

Get hands-on with 1200+ tech skills courses.