Golang packaging: Difference between revisions
From wikinotes
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
How to install executables,<br> | |||
< | manage project requirements,<br> | ||
and publish your project to the go index (or create a private module). | |||
= Locations = | = Locations = | ||
Line 16: | Line 7: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
| go | | <code>~/go/bin</code> || default <code>$GOBIN</code> path, where go executables are installed | ||
| | |||
| go | |||
|- | |- | ||
|} | |} | ||
</blockquote><!-- Locations --> | </blockquote><!-- Locations --> | ||
= OS Package Management = | = OS Package Management = | ||
Line 48: | Line 29: | ||
rm ${GOBIN:=~/go/bin}/tool-to-delete | rm ${GOBIN:=~/go/bin}/tool-to-delete | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Package Management --> | </blockquote><!-- OS Package Management --> | ||
= Creating/Hosting Packages = | |||
<blockquote> | |||
In order to hosting packages for OS-install, you simply need to expose the src using the module path.<br> | |||
It will be compiled for the platform automatically. | |||
* See [[golang modules]] for creating modules, managing their requirements, and publishing to the public package index | |||
* See [[golang module path]] for instructions on private package hosting | |||
</blockquote><!-- Project Requirements --> |
Latest revision as of 03:52, 20 June 2022
How to install executables,
manage project requirements,
and publish your project to the go index (or create a private module).
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, managing their requirements, and publishing to the public package index
- See golang module path for instructions on private package hosting