Module 02 of 12

Go Basics

Lessons

About This Module

With your environment ready, it is time to learn the language itself. Go is deliberately small: a handful of building blocks that you combine to write clear, readable programs. Getting these basics right makes every later module easier.

This module starts with variables and data types, how to store values and what kinds of values Go works with. It then covers conditionals with if, else if and else, and for loops, Go's way of repeating work. Finally, it introduces functions, the reusable blocks of code that every Go program is built from.

Watch the lessons in order and write the examples yourself as you go, then continue on to Data Structures.

Lessons

4 videos
01

Golang Tutorial #2: Variables & Data Types

An introduction to variables and the different data types in Go, including the different ways to create variables and how Go decides what type each one has.

02

Golang Tutorial #9: If, Else If, Else

How conditional blocks work in Go: using if, else if and else so that code runs only when a certain condition is true.

03

Golang Tutorial #10: For Loops & While Loops

Go's for loop in detail. Go's implementation lets you write loops in several different ways, so this lesson shows the forms you will meet in real code.

04

Golang Tutorial #16: Functions

Functions as reusable blocks of code that accept values from the caller and return values back, the starting point for structuring any Go program.