Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.52 KB

File metadata and controls

53 lines (34 loc) · 1.52 KB

Tour of Go

🏆 Objectives

  1. Get to know the general syntax of the Go programming language.

[20m] 💻 Activity: Tutorial Scavenger Hunt

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:

  1. what is every Go program made up of?
  2. show two ways you can write import statements
  3. does capitalization matter in Go?
  4. how many arguments can a function take in Go?
  5. what is a type?
  6. how many results can a function return in Go?
  7. what is a "naked" return?
  8. what's a var statement?
  9. where can vars be declared?
  10. do you always need to declare the type when programming in Go?
  11. what two ways allow you to declare a variable in Go?
  12. when can't you use the walrus operator?
  13. show two examples of numeric type conversion:
  14. what language are the characters on page 15?
  15. what does it mean in English?

[15m] 🌴 BREAK {docsify-ignore}

[30m] 💻 Activity: More Tour!

In different breakout groups, work on the answers for section 3 (pages 1-14):

  1. name the three parts of a for loop?
  2. what order are switch statements evaluated?
  3. explain "defer" in your own words

[30m] 💻 TT: Compare Answers

Review the questions and answers for the first 3 sections of the Tour of Go.

After Class

Ask students to complete https://go.dev/tour/moretypes and https://go.dev/tour/methods for homework.