Programming in Go
496 pages
English
PDF
4.5

Programming in Go

Programming in Go

Author:

Year:

Summary:

Introduction

The book «Programming in Go» (2012) by Mark Summerfield is one of the first fundamental publications on the Go language (Golang), which remains relevant today. Despite the fact that more than ten years have passed since its release, the book lays a solid foundation for understanding the philosophy of Go, its syntax, type system, and unique features such as goroutines and channels. Summerfield is a well-known technical writer, author of books on C++, Qt, and Python, so his writing style is characterized by clarity, structure, and a practical focus.

What the book is about

The book covers all key aspects of Go version 1 (at the time of writing): from installing the toolchain to writing multithreaded applications and working with network protocols. Main topics:

  • Installing Go, setting up the environment, project structure (GOPATH, packages).
  • Basic syntax: variables, data types, control structures, functions.
  • Type system: structs, interfaces, methods, embedding.
  • Collections: slices, maps, arrays.
  • Error handling (error interface, panic/recover).
  • Concurrency: goroutines, channels, select, sync primitives.
  • Working with files, input/output, formatting.
  • Testing, benchmarking, profiling.
  • Creating web servers, working with HTTP, JSON, XML.
  • Reflection and metaprogramming.

Who this book is for

The book is intended for programmers who already have experience in other languages (C, C++, Java, Python, Ruby). It is not a textbook for absolute beginners in programming — it assumes the reader is familiar with basic concepts (variables, loops, functions, OOP). However, for those who want to learn Go quickly and deeply, this is an excellent start.

What the reader will learn

  • How to write idiomatic Go code, following the principles of simplicity and readability.
  • How to effectively use goroutines and channels for parallel computing.
  • How to design programs using interfaces and composition instead of inheritance.
  • How to work with packages, modules, and dependencies (although modules appeared later, the foundations are laid).
  • How to write tests and benchmarks built into the Go toolchain.
  • How to create HTTP servers and handle JSON/XML.
  • How to apply reflection to work with dynamic types.

Strengths

  • Structure: each chapter logically follows the previous one, with examples of increasing complexity.
  • Practical focus: many code listings that can be immediately run and modified.
  • In-depth explanation of concurrency: chapters on goroutines and channels are written so clearly that even complex topics become understandable.
  • Attention to detail: the author examines the nuances of working with memory, interfaces, zero values, which is important for writing reliable code.
  • Emphasis on Go idioms: the book teaches not just syntax, but the correct style accepted in the community.

Who is recommended

The book will be useful for:

  • Developers transitioning to Go from other languages (especially C/C++/Java).
  • Students and instructors of courses on modern programming languages.
  • Those who want to understand the internal logic of Go and its differences from other languages.
  • Engineers working on network or high-load systems.

If you are looking not just for a reference, but a comprehensive guide that will take you from the first lines to creating real applications, «Programming in Go» is an excellent choice. Despite its age, the book has not lost its relevance in terms of fundamentals, although studying new features (modules, generics) will require additional sources.

Recommendations