Whether you want to automate tasks, analyze data, parse logs, talk to network services, or address other systems requirements, writing your own command-line tool may be the fastest - and perhaps the most fun - way to do it. The Go programming language is a great choice for developing tools that are fast, reliable, and cross-platform. Create command-line tools that work with files, connect to services, and even manage external processes, all while using tests and benchmarks to ensure your programs are fast and correct. When you want to develop cross platform command-line tools that are fast and reliable, use Go, a modern programming language that combines the reliability of compiled languages with the ease of use and flexibility of dynamic typed languages. Work through practical examples to develop elegant and efficient tools by applying Go's rich standard library, its built in support for concurrency, and its expressive syntax. Use Go's integrated testing capabilities to automatically test your tools, ensuring they work reliably even across code refactoring. Develop CLI tools that interact with your users by using common input/output patterns, including environment variables and flags. Handle files to read or persist data, and manipulate paths consistently in cross-platform scenarios. Control processes and handle signals, and use a benchmark driven approach and Go's concurrency primitives to create tools that perform well. Use powerful external libraries such as Cobra to create modern and flexible tools that handle subcommands, and develop tools that interact with databases, APIs, and network services. Finally, leverage what you learned by tackling additional challenges at the end of each chapter. What You Go 1.8 or higher, an internet connection to download the example files and additional libraries, and a text editor to write your programs.
Overall solid read, with good discussion of the process of developing your first CLI tools in Go. It works well as a guide of the types of problems that you will have to solve and tasks that you should consider doing.
The book itself is a touch dated at this point wrt some style things, and the libraries being used, as well as being pretty tied to using cobra/viper. That being said a lot of the overall software engineering is on display is solid and it gives you a good jumping off point to find the tools that you want to use to solve your problems.
I really appreciated that the section using http a) actually walked you through how/why, not just assuming that you knew all of this already, and b) didn't have subsequent chapters be super dependent on them. Similarly there is work with SQL, but the details that you need are presented as context in the text.
Other then the afore mentioned cobra/viper bit, the books is pretty self contained, and even the bits that are not, they can either be swapped out with other libraries or custom bits as needed, since things are structured to be very modular in the code presented (and good Go code in general).
What a dense book. As someone without formal CS backgroud, this book completely changed the wat I write programs, even in other languages. Great, useful examples that you could tweak a little to really create awesome programs for your own use, with the difficulty steadly and surely increasing until the final chapters.
You do really need to know a little Go, but the book does not use any bizarre constructs.
Expect a lot of typing - in fact, too much, and it can become tiresome to follow along as Gerardi tells you to "declare a package", "include imports" and so on. But there is so much to learn about software development: creating data structures, writing small functions, connecting modules, using third-party libraries.
The book is so well written, Also it cover writing tests for variety types of console applications. Highly recommended specially for beginners because book is fun and valuable lessons.
Ricardo did an excellent job of showing how to develop awesome Go CLI tools, and he integrated Testing in each step! One of the best Go books, and one of the best programming best I've read.
A fun way to master Go's advanced features by writing CLI programs. A little hefty (over 500 pages), a trade-off resulting from the author's working every example completely and in marvelous detail.
I'd wouldn't say this is a good book for beginners. To really understand what is happening in the code you must research it on your own - which I think is a good thing. A good complementary source is the "Learning Go" that explains concepts that are rushed in this book. Some mini-projects are well picked for the wide variety of concepts introduced - from basic idioms to quirks of standard library. I really liked the benchmarking and profiling section that is built-in into the language. There are however, long, boring and frustrating parts that I had force myself through. It is quite often that the author doesn't really guide me through the creation of the program. Lots of "Type this cause you will need it later" is an admission that the train of thought is broken. I have written a few code alongs and know this is really hard to get it right. I'd say the author got it 50% of the time.
The next thing that annoyed me were the tests. It is a matter of taste, but for me table tests in go are overkill and go against the simplicity and readability. I spent more time understanding what the tests are doing than the code itself. Especially that go promotes verbosity and clarity over compaction and convolution. It probably happened because otherwise 50% of book would be unit tests code snippets.