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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.