diff --git a/Development/Go/Modules.md b/Development/Go/Modules.md new file mode 100644 index 0000000..3fe219c --- /dev/null +++ b/Development/Go/Modules.md @@ -0,0 +1,37 @@ +# [Modules](https://github.com/golang/go/wiki/Modules) + +First time: + +``` +go mod init +``` + +Daily workflow: + +``` +# Update modules +go get -u ./... + +# Install module with chosen commit or branch +go get public.git.com/module@branch + +# Prune no longer used modules +go mod tidy + +# Copy modules to local vendor directory +go mod vendor +``` + +In world of corporation, we work with private repository, add to `~/.bashrc`, `~/.zshrc`: + +```sh +export GOPRIVATE=private.git.com +``` + +Last hope, use `~/.netrc`: + +```txt +machine private.git.com +login your_user +password your_password +```