HomeToolsAbout a20k

Packages

What is it

Install a package

Go packages are installed via a go get command.

go get github.com/some/module

Running the go get command will list the installed package in go.mod module file

  • In the mod file, require() method will list the dependencies link and versions (automatically listed once compiled)
require ( github.com/some/module v0.14.0 // indirect )

Update a package

go get -u example.com/some-module

alias package import

import ( "text/template" // this is imported as htmltemplate to avoid collision htmltemplate "html/template" )
© VincentVanKoh