Exercises

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Improving the Markdown Pre view Tool with Templates | TOC | Wrapping Up 👉

Try the following exercises to apply and improve the skills you’ve learned:

  • Go back to the example in Chapter 1, Your First Command-Line Program in Go, and update the wc tool to read data from files in addition to STDIN.
  • Update the wc tool to process multiple files.
  • Update the mdp tool template by adding another field that shows the name of the file being previewed.
  • Update the mdp tool allowing the user to specify a default template using an environment variable.
  • Update the mdp tool allowing the user to provide the input Markdown via STDIN.

👈 Improving the Markdown Pre view Tool with Templates | TOC | Wrapping Up 👉

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.