Mastering Go
Author: Mihalis Tsoukalos
Review created: 2018-10-09
Mastering Go by Michalis Tsoukalos is a book about programming Go on a Unix computer with the aim to deploy the resulting program an a Unix computer. If you're into Windows programming, you'd better choose another book.
The audience of the book is people that knows at least a little about go and wants to know more, especially about how Go works in a Unix environment. It may also be appropriate for Go novices that are really strong in C or a similar language. I read Mastering Go as my third Go book (after Introducing Go and The Go Programming Language), and I felt that it suited me fine. I got to repeat much of what I'd read in the other two books, I learned some new stuff and I got a deeper understanding of some stuff that I knew a little about before.
The book has, in my opinion, a rather unusual format. It contains may pages (576), but each pages takes a very short time to read. This is due to a rather large font size being used and also to the facts that the program listings (which are split into parts) always contain import statements and that the output of an example execution of the programs always are listed (and they can be quite long). I'm undecided if I like the format or not. It was a bit of a pain to carry the book around, because it was so heavy, but the format makes it quite easy to follow what's going on. Also, you feel quite satisfied with yourself when you are able to finish many pages in a short time ;)
Mastering Go starts quite conventionally in chapter one with a description on how to compile Go programs and how to download and install packages. Then, in the same chapter, logging and error handling (including the Error data type) are discussed. This is a bit irregular. I suspect that in most other books, such topics would be saved for later chapters.
Chapter two in the book contains some really interesting parts. In this chapter, the algorithm used by the Go garbage collector is discussed. This was really interesting stuff. Other things in the chapter includes how to call C code from Go and vice versa, how to write unsafe code in Go and why one might want to do that, how the defer and panic keywords work and some info about the Go assembler. In this chapter as in many of the other chapters, some useful Unix tools (strace and dtrace in this case) are presented. These tools are not specific to Go, but can come in quite handy in other situations as well. This, that the Go specific stuff is mixed with useful Unix info, is one of the strengths of the book, I think.
Later chapters in the book contains a wide variety of Go topics. The usual explanations of loops, array, slices and so forth, but also chapters on reflection, testing and two chapters on concurrency (which, the author sternly tells us, is not the same as parallelism) are included. These explanations are all solid and good.
The book end with two chapters on network programming. Those I found really useful and interesting.
Each chapter ends with a summary, links to other resources related to the info presented in the chapter and a fair number of exercises also related to the stuff in the chapter.
Summary: Mastering Go is an interesting book. The material in the book includes a broad range of things and is explained in a clear fashion that is easy to follow. The somewhat unusual order in which the topics are presented and the Unix stuff that is mixed into the Go info makes it easier to keep up the concentration.
I'm not sure I like the large font. I always associate large font sizes with books that is written for total novices who the author thinks will have real problems understanding what he/she writes. This is absolutely not the case for this book, Michalis Tsoukalos seems to regard the reader as a competent, interested programmer, but I can still no shake of the feeling that I would have liked the book even more if it had used a slightly smaller font.
I would recommend the book to intermediate Go programmers who are interested in programming Go in a Unix/Linux/Mac environment. If you're not developing on Unix and you can stand the frequent references to that OS, I think you would find Mastering Go useful anyway. It is really packed with loads of useful information.