Foreword

Powerful Command-Line Applications in Go — by Ricardo Gerardi (2 / 127)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Early Praise for Powerful Command-Line Applications in Go | TOC | Acknowledgments 👉

In 2012 I began a journey of experimentation in investigating a new language, Go, which was born at Google and had just reached the 1.0 milestone. I learn best by building so I was looking for a project meaningful enough to actually learn Go. I was growing frustrated with the increasing cost and complexity of my WordPress-powered blog with entirely static content and decided that building a static site generator was the project for me to learn Go. I began writing my first Go project, Hugo[1].

Having previously designed several CMSs and command-line tools, I had a good sense of what I wanted to build. I opened up a terminal and began by typing commands for this not yet existing program to effectively sketch out how the user interface would be shaped. With this sketch in hand, I then began the process of building the application. As I was inexperienced with Go, I hoped to lean heavily on existing libraries, but as this was the dawn of the Go ecosystem, more often than not, the libraries I needed didn’t exist.

Unable to find the right library to support the design pattern of [application] [command] [flag] [argument], I set out to write it myself. I also needed config file management as there was too much configurability to anticipate everything passed via the command line. As my goal was building Hugo, these were…

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.