Wrapping Up

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

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Exercises | TOC | You May Be Interested In… 👉

When it comes to distributing your application, Go supports many alternatives. Because Go applications don’t require an interpreter or a runtime, you can distribute your application in binary form, and users can run it without installing or maintaining extra dependencies. You can also distribute it as source code so users can build it themselves according to their requirements.

In this chapter, you created a new package that enables your applications to send system notifications and supports different operating systems. You designed this package to use different implementations according to the target operating system by using Go build constraints. Then, you included the notification package in the Pomodoro application and used build tags to conditionally build it for different requirements. Finally, you explored several options for building and distributing your application in binary form and as source code. You used the power and flexibility of cross-compilation to build binaries for different platforms using a single-source system. You also created container images so users can run your application as Linux containers.

The Go toolchain provides a complete set of tools that allows you to develop automated ways to build your application in a consistent and repeatable way. With Go test tools, you can develop automated pipelines to test and…

--

--

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.