Chapter 10Packaging and Production

In this last chapter we’ll look at two distinct items. First, we’re going to check out how you can make reusable packages to share between projects, or even modularize your code within a single project. Then we’ll look at how to get your code into production, and the various methods for dependency management that the Go community uses.

Creating Packages

So far we’ve created all our code in the main package, and only consumed other packages. Eventually you’re likely to want to split code that fits together as a logical module into its own package. Having code in a separate package means that you can encapsulate all the logic into a single area, as well as hide a lot of the internal workings from other packages, ...

Get Level Up Your Web Apps With Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.