Jump to ratings and reviews
Rate this book

Mastering Go: Create Golang production applications using network libraries, concurrency, machine learning, and advanced data structures

Rate this book

Dive deep into the Go language and become an expert Go developer

Key Features Second edition of the bestselling guide to advanced Go programming, expanded to cover machine learning, more Go packages and a range of modern development techniques Completes the Go developer’s education with real-world guides to building high-performance production systems Packed with practical examples and patterns to apply to your own development work Clearly explains Go nuances and features to remove the frustration from Go development Book Description

Often referred to (incorrectly) as Golang, Go is the high-performance systems language of the future. Mastering Go, Second Edition helps you become a productive expert Go programmer, building and improving on the groundbreaking first edition.

Mastering Go, Second Edition shows how to put Go to work on real production systems. For programmers who already know the Go language basics, this book provides examples, patterns, and clear explanations to help you deeply understand Go’s capabilities and apply them in your programming work.

The book covers the nuances of Go, with in-depth guides on types and structures, packages, concurrency, network programming, compiler design, optimization, and more. Each chapter ends with exercises and resources to fully embed your new knowledge.

This second edition includes a completely new chapter on machine learning in Go, guiding you from the foundation statistics techniques through simple regression and clustering to classification, neural networks, and anomaly detection. Other chapters are expanded to cover using Go with Docker and Kubernetes, Git, WebAssembly, JSON, and more.

If you take the Go programming language seriously, the second edition of this book is an essential guide on expert techniques.

What you will learn Clear guidance on using Go for production systems Detailed explanations of how Go internals work, the design choices behind the language, and how to optimize your Go code A full guide to all Go data types, composite types, and data structures Master packages, reflection, and interfaces for effective Go programming Build high-performance systems networking code, including server and client-side applications Interface with other systems using WebAssembly, JSON, and gRPC Write reliable, high-performance concurrent code Build machine learning systems in Go, from simple statistical regression to complex neural networks Who this book is for

Mastering Go, Second Edition is for Go programmers who already know the language basics, and want to become expert Go practitioners.

Table of Contents Go and the Operating System Understanding Go Internals Working with Basic Go Data Types The Uses of Composite Types How to Enhance Go Code with Data Structures What You Might Not Know About Go Packages and functions Reflection and Interfaces for All Seasons Telling a Unix System What to Do Concurrency in Go: Goroutines, Channels, and Pipelines Concurrency in Go: Advanced Topics Code Testing, Optimization, and Profiling The Foundations of Network Programming in Go Network Programming: Building Your Own Servers and Clients Machine Learning in Go

798 pages, Kindle Edition

Published August 29, 2019

137 people are currently reading
190 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
27 (28%)
4 stars
33 (35%)
3 stars
28 (29%)
2 stars
5 (5%)
1 star
1 (1%)
Displaying 1 - 12 of 12 reviews
Profile Image for Yiorgos Adamopoulos.
40 reviews11 followers
September 22, 2019
[ This is a copy of my Amazon review ]

I like this book. I really do. I started learning Go reading "The Go Programming Language" which one can view as Go's K&R. But like not everyone can learn from K&R, the same holds for TGPL too. This is the gap that this book closes. You cannot be scared. You can finish the Tour of Go in Golang's web site and then start the book.

Information presented in the book is in small pieces. That is the author's style if you've also read his other book. It helps. You can read it in coffee breaks and write a few lines of the examples, compile, run, test and be happy with the result. You become immediately productive once you've mastered the concepts of the language. By that I do not mean that you magically become a Go expert programmer, but with the book you get a faster pace on the subject that matters to you. You can dive right into it as a junior Go programmer within the first week. Because the presentation style that allows for you to study in small chunks helps you with that. You will never stop halfway through a section because the break is over. You will never type lots of lines before you make an example work.

How do you eat an elephant? By eating one bit at a time. The same with Mastering Go. You master it one section at a time. That is the gift of the book.

Disclaimer: I was gifted the book by the author and the publisher as I relentlessly proof-read and corrected typing errors in his other book.
464 reviews16 followers
May 10, 2020
I've been reading this for months, off-and-on, because I'd been writing some Go stuff and finding it pretty straightforward (and almost nostalgic) but being not really comfortable with my strategies for structuring larger apps with its blend of pseudo-OO interfaces and not-quite-functional-but-also-highly-mutable attitude.

But, like a lot of Packt books, this consists primarily of the author taking some aspect of the topic, writing an isolated chapter on it that's about at the level of what you get from the docs, and not really adding much in the way of insight. This is almost at a cargo cult level at this point.

For instance, you don't want to (in your programming book) put up a wall of code the reader has to struggle through (unless it's just meant to be a full listing you've already covered). So what you do is break up the code bit-by-bit and explain the significance each part. You can even skip parts of the code if they're boilerplate or already covered.

This book presents the entire code every time I think, but then breaks it up this way:

This shows the first part of the code
The next few lines show the next section of the code
And here's the last section of the code

And in a lot of cases, that's all the explanation there is. Sometimes it's because that's all that's needed and others it's probably due to word counts or page quotas or something related to the mechanical process of publishing. But is extraordinarily unenlightening.

The English is otherwise passable (unlike some other Packt books I've read recently) but the number of times I went to the official docs for clarification was very high.

Look, here's the thing: Official docs tend to be very dry and deal with the mechanics of things. You get a book like this to tell you why things are done a certain way, and what problems they might solve. Pointing out that Go has three different data structures in its standard library, and then running through some already fairly intuitive interfaces is not very helpful. We code to solve problems: When you give me an example of a Heap, tell me what problem I might uniquely solve with it.

The interface stuff is especially bad, with interfaces called A and B and instances that are also one letter and demonstrate on a basic level a very minor "this is how you'd do something trivial" but no real depth.

At one point, the author says, hey, if you want to design something OO, you're out of luck. Maybe go use Python. (Another weird side note, we learn he doesn't like Java, apparently, so he wouldn't recommend it. Newsflash: A lot of people don't like Java and that has very little bearing on whether or not it's useful to learn.)

I can only assume the economics of writing tech books in the 21st century is so bad, publishing houses are just luring whomever they can convince to throw words on a page, not really editing either on a language or tech level, and just churning stuff out on every conceivable topic figuring to sucker guys like me into their $10/month plans.
Profile Image for Dmytro Shteflyuk.
53 reviews19 followers
May 16, 2020
A large semi-organized cookbook of different things you can do with Go. Not all the samples are of equal quality (some crash, other just look awful). Overall I can’t even say what is the target audience of this book.
Profile Image for Vlad Bezden.
236 reviews14 followers
August 22, 2019
Good examples and explanation. I also like exercises. I would not recommend this book for beginners. I use this book more for expanding Go knowledge and for looking at examples.
Profile Image for Denis Romanovsky.
215 reviews
June 26, 2020
Just a very good overview of Go language capabilities. Nothing more, nothing less... Go appears quite easy to start and it is very strong in regards to server-side programming.
Profile Image for Denys.
24 reviews
August 30, 2020
It's a good book to review the basics of Go and different use cases until a little bit of statistics and machine learning.
195 reviews
February 10, 2024
Fine book, but the title is deceiving. It is project focused, and you can learn while building something together. But you won’t be mastering go with it.
Profile Image for Anh Tran.
65 reviews31 followers
August 2, 2023
Appendix A on the Go garbage collector caught my attention, but other than that, there wasn't anything noteworthy.
Displaying 1 - 12 of 12 reviews

Can't find what you're looking for?

Get help and learn more about the design.