What’s in This Book

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Preface | TOC | How to Use This Book 👉

In Chapter 1, Your First Command-Line Program in Go, you’ll take a quick tour through the process of developing a command-line application with Go by building a word counter. You will start with the basic implementation, add some features, and explore testing. You’ll also add command-line flags and build this application for different platforms.

In Chapter 2, Interacting with Your Users, you’ll design and write a command-line tool to manage lists of to-do items in accordance with common input/output standards by applying different techniques. You’ll take input from the standard input (STDIN) stream, parse command-line parameters, and define flags for your tool using the flags package. You’ll use environment variables to increase the flexibility of your tools. In addition, you’ll display information and results back to the user through the standard output (STDOUT) stream, and present errors using the standard error (STDERR) stream for proper error handling. Finally, you’ll explore Go interfaces by applying the io.Reader interface in particular.

Next, in Chapter 3, Working with Files in Go, you’ll develop a tool to preview Markdown files using a web browser. You’ll create and open files for reading and writing. You’ll apply techniques to handle paths consistently across different operating systems. You’ll use temporary files and apply…

--

--

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.