Structuring Go Code for CLI Applications
Programming is like any other creative process. It all begins with a blank slate. Unfortunately, when faced with a blank slate and minimal experience with programming applications from scratch, doubt can kick in – without knowing how to start, you may feel that it’s not possible at all.
This chapter is a guide on the first steps of creating a new application, beginning with some of the most popular ways to structure code, describing each, and weighing up their pros and cons. The concept of domain-driven design is discussed, as this can also influence the resulting structure of an application.
An example of an audio metadata CLI application gives us an idea of what some real-world use cases or requirements could look like. Learning how to define an application’s use cases and requirements is a tedious but necessary step to ensuring a successful project that also meets the needs of all parties involved.
By the end...