Structuring an application
Go applications are structured inside directories, with each directory containing Go source code that means something for those applications. There are many ways to structure your Go application in different kinds of directories; however, one thing that you have to remember is to always give a directory a name that will be easy for others to understand. As an application grows with time, the chosen directory structure and where code is placed has a big impact on how easily other developers in your team will be able to work with the code base.
Defining packages
Up to this point, we’ve kept things fairly simple, but we’re going to up our game a little and move to a fairly common layout. We won’t use the term “standard layout,” as there’s no such thing in Go, but we’ll look at how we’re structuring our new project and talk about how we reason them through to best structure our Go application for clarity...