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
Table of contents
- Title: Managing Dependencies in Go
- Release date: May 2020
- Publisher(s): Aaron Schlesinger
- ISBN: None
You might also like
React - The Complete Guide (Includes Hooks, React Router, and Redux) - Second Edition
**This course is now updated for the latest version of React—React 18** React.js is the most …
Java Coding Problems
Develop your coding skills by exploring Java concepts and techniques such as Strings, Objects and Types, …
Learn Flutter and Dart to Build iOS and Android Apps (2023)
What makes Flutter the best framework to build mobile apps? With Flutter, you can build mobile …
The Staff Engineer's Path
For years, companies have rewarded their most effective engineers with management positions. But treating management as …