Chapter 1 Your First Command-Line Program in Go

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Online Resources | TOC | Building the Basic Word Counter 👉

Whether you’re looking to automate a task, analyze data, parse logs, talk to network services, or address other requirements, writing your own command-line tool may be the fastest — and perhaps the most fun — way to achieve your goal. Go is a modern programming language that combines the reliability of compiled languages with the ease of use and speed of dynamically typed languages. It makes writing cross-platform command-line applications more approachable while providing the features required to ensure these tools are well designed and tested.

Before you dive into more complex programs that read and write files, parse data files, and communicate over networks, you’ll create a word counter program that will give you an idea of how to build and test a command-line application using Go. You’ll start with a basic implementation, add some features, and explore test-driven development along the way. When you’re done, you’ll have a functional word counter program and a better understanding of how to build more complex apps.

Throughout the book you’ll develop other CLI applications to explore more advanced concepts.

👈 Online Resources | TOC | Building the Basic Word Counter 👉

Powerful Command-Line Applications in Go by Ricardo Gerardi can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

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.