- Get to know the general syntax of the Go programming language.
Introduce students to the Tour of Go.
Ask them to complete sections 1 (pages 1-5) and 2 in small breakout groups, and to answer the following questions in their notes:
- what is every Go program made up of?
- show two ways you can write import statements
- does capitalization matter in Go?
- how many arguments can a function take in Go?
- what is a type?
- how many results can a function return in Go?
- what is a "naked" return?
- what's a var statement?
- where can vars be declared?
- do you always need to declare the type when programming in Go?
- what two ways allow you to declare a variable in Go?
- when can't you use the walrus operator?
- show two examples of numeric type conversion:
- what language are the characters on page 15?
- what does it mean in English?
In different breakout groups, work on the answers for section 3 (pages 1-14):
- name the three parts of a for loop?
- what order are switch statements evaluated?
- explain "defer" in your own words
Review the questions and answers for the first 3 sections of the Tour of Go.
Ask students to complete https://go.dev/tour/moretypes and https://go.dev/tour/methods for homework.