Go Tutorial menu

Go Quiz

Use this quiz to check what you have learned in the Go tutorial.

How the Quiz Works

  • 8 questions cover every lesson
  • Choose one answer for each question
  • An explanation appears after you answer
  • Revisit the lesson for any question you get wrong

Quiz Questions

Exercise

Which statement declares and sets a variable inside a function in the shortest way?

Exercise

What is the zero value of a string in Go?

Exercise

Which keyword is the only loop in Go?

Exercise

What does append do with a slice?

Exercise

What does v, ok := m["key"] tell you when ok is false?

Exercise

How does Go usually report a failure from a function?

Exercise

Which receiver should a method use if it changes the struct's fields?

Exercise

Which statement runs a call only when the surrounding function ends?

What Next?

Well done. With these basics you can start building command-line tools and simple web servers. Next, explore goroutines and channels, which let Go do many things at the same time.

Try a small project: a to-do list that saves to a file, or a tiny API that returns prices of items in a shop.

Learn Go with a teacher

Join the Python Programming course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp