Installing External Packages
Explore how to install external packages in Go using the go get command. Understand how package paths work, manage dependencies automatically, use flags like -v for verbose output and -u for updates, and distinguish between go get and go install commands. This lesson helps you effectively integrate external libraries into your Go projects.
We'll cover the following...
Introduction
If you need one or more external packages in your application, you will first have to install them locally on your machine with the go get command.
Suppose you want to use a (fictional) package which can be downloaded from the not-existent URL
http://codesite.ext/author/goExample/goex, where codesite could be googlecode, github, bitbucket, launchpad or others. Where ext is the extension. The correct name for this is TLD (Top-Level Domain) like .com or .org. The goex is the package name (often these start with go, but this is by no means a necessary convention).
You install this with the command:
go get codesite.ext/author/goExample/goex
This installs the ...