Wrapping Up

Let's wrap up this chapter.

We'll cover the following

Summary

In this chapter:

  • We used the Cobra framework and the net/http package to develop a command-line application that interacts with a remote REST API using different techniques and options.
  • We also used the encoding/json package to parse JSON data.

These skills allow us to gather data from a variety of sources on the internet or from our environment to create powerful and flexible tools.

We also explored and applied several techniques for testing our API server and our command-line client implementation. By combining unit tests with simulated responses and test servers, we can execute constant local tests while using integration tests sporadically to ensure our application works reliably across different environments.

What will we learn next?

In the next chapter, we’ll develop an interactive terminal application.

Get hands-on with 1400+ tech skills courses.