Distributing Your Application as Source Code

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Compiling Your Go Application for Co ntainers | TOC | Exercises 👉

So far, you’ve explored some options for distributing your application as binary files that users can run directly on their system. Using this approach, users don’t have to worry about building the application, and they can start using it right away.

But in some cases, you may want to distribute your application’s source code and allow users to build it, selecting the options that meet their requirements. For example, for the Pomodoro application, users could build it using any of the available repositories, enabling or disabling notifications.

This provides users with additional flexibility but requires an extra step of building the application. Another benefit is that by having access to the source code, other developers can expand or add more features to the application, for example, by introducing an additional data store to meet their needs.

To distribute your application as source code, you need to host it in a publicly available location. Typical places include a hosted version control system, such as GitLab or GitHub. Another requirement is to have your application dependencies available for the end users. In general, you host any dependencies on a public platform as well.

--

--

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.