Skip to Content
Get Programming with Go
book

Get Programming with Go

by Nathan Youngman, Roger Peppe
September 2018
Beginner
360 pages
9h 28m
English
Manning Publications
Content preview from Get Programming with Go

Lesson 3. Loops and branches

After reading lesson 3, you’ll be able to

  • Have your computer make choices with if and switch
  • Repeat code with for loops
  • Use conditions for looping and branching

Computer programs rarely read from beginning to end like a novel. Programs are more like Choose Your Own Adventure books or interactive fiction. They take different paths under certain conditions or repeat the same steps until a condition is met.

If you’re familiar with the if, else, and for keywords found in many programming languages, this lesson will serve as a speedy introduction to Go’s syntax.

Consider this

When Nathan was young, his family would play Twenty Questions to pass the time on long trips. One person would think of something, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Go Web Programming

Go Web Programming

Sau Sheong Chang
Java Coding Problems

Java Coding Problems

Anghel Leonard

Publisher Resources

ISBN: 9781617293092Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link