Developers using the Microsoft technology stack have adopted NuGet as a primary dependency manager. NuGet provides a clean way to acquire interesting reusable components from a reliable public source, stay up to date with new versions of the components (or not), and even use your own NuGet private NuGet repository internally.
One of Go’s strengths is its extensibility. Almost anything that can be run from a command line can be integrated into a Go pipeline and value stream.
This blog shows you how to use NuGet with Go to:
Build and publish NuGet packages to public and internal repositories. You can choose to publish manually or automatically as part of a full-up continuous delivery value stream. Mingle.NET is an example of a NuGet package that is built, tested and published this way.
Acquire NuGet packages on the fly at build time from public and private repositories. You can choose whether to get the most recent versions of such packages or not.
You publish NuGet packages from Go using the NuGet command line utility. This is true for both public and private repositories. To use the NuGet command line you need to have its software on each machine running Go agent(s). Here you have choices:
Note: “Allow NuGet to download missing packages during build” fetches package versions as listed in packages.config in your project. It does not download the latest available versions of packages. We’ll deal with this issue under Acquiring Packages below.
Assuming you have defined your package(s) with appropriate .nuspec files, you can publish from Go using a command line like this: