Golang packaging: Difference between revisions
From wikinotes
Line 37: | Line 37: | ||
* See [[golang modules]] for creating modules, and managing their requirements. | * See [[golang modules]] for creating modules, and managing their requirements. | ||
* See [[golang module path]] | * See [[golang module path]] for instructions on package hosting | ||
</blockquote><!-- Project Requirements --> | </blockquote><!-- Project Requirements --> |
Revision as of 03:51, 20 June 2022
How to install executables,
manage project requirements,
and publish your project to the go index.
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@latestUninstalling Packages
# there doesn't seem to be a managed way of doing this rm ${GOBIN:=~/go/bin}/tool-to-delete
Creating/Hosting Packages
In order to hosting packages for OS-install, you simply need to expose the src using the module path.
It will be compiled for the platform automatically.
- See golang modules for creating modules, and managing their requirements.
- See golang module path for instructions on package hosting