Golang packaging: Difference between revisions

From wikinotes
No edit summary
No edit summary
Line 1: Line 1:
How to install executables and manage project requirements.


= Locations =
= Locations =

Revision as of 14:19, 19 June 2022

How to install executables and manage project requirements.

Locations

~/go/bin default $GOBIN path, where go executables are installed


OS Package Management

Installing Packages

# golang < 1.18
go get -u example.com/x/foo

# golang >= 1.18
go install example.com/x/foo@latest

Uninstalling Packages

# there doesn't seem to be a managed way of doing this
rm ${GOBIN:=~/go/bin}/tool-to-delete

Project Requirements

See golang modules.