Summary

This chapter provided a walkthrough of the mechanism of control flow in Go, including if, switch, and for statements. While Go's flow control constructs appear simple and easy to use, they are powerful and implement all branching primitives expected of a modern language. Readers are introduced to each concept with ample detail and examples to ensure clarity of the topics. The next chapter continues our look into Go fundamentals by introducing the reader to the Go type systems.

Get Learning Go Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.