Managing Dependencies in Go

Video description

Almost all modern software projects use third-party dependencies to do their job. From version control systems and simple string manipulation to powerful data storage and manipulation, the vast majority of teams can't get their work done without help from outside packages. Often, these packages come from open source as well.

In Go, dependencies are called "packages" or "modules". Packages are the smallest unit of grouped Go code, and modules are the modern unit of package distribution. Both packages and modules have a URL naming scheme - similar, but distinctly different from the Java naming scheme for Jars. In the modern Go ecosystem, there are several methods by which you can fetch packages and modules and include them in your project. In this section we'll look at what both packages and modules are, how to find them and how to include them in your project, and then move onto advanced topics like managing private code, storing your dependencies onsite (instead of in a public, hosted environment), and improving build determinism and speed.

You'll learn how to get started with packages and modules, several methods to manage either dependency type, convert your existing project to modules, and how to manage your dependencies for the duration of your project, no matter how long.

* The Go dependency management ecosystem has evolved significantly in the history of the language. Modules, however, are the de-facto standard and are built into the official Go CLI tooling. If you're starting a new project, I highly recommend using modules, and if you're using another technology for dependencies, I recommend researching whether you can switch to modules. This section covers both scenarios

Product information

  • Title: Managing Dependencies in Go
  • Author(s): Aaron Schlesinger, No Time Labs
  • Release date: May 2020
  • Publisher(s): Aaron Schlesinger
  • ISBN: None