mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
39 lines
798 B
Plaintext
39 lines
798 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# goenv
|
|
|
|
> Install, uninstall, or switch between Golang versions.
|
|
> Supports version numbers like "1.16.15" or "1.22.8" etc.
|
|
> More information: <https://github.com/go-nv/goenv>.
|
|
|
|
- List all available goenv commands:
|
|
|
|
`goenv commands`
|
|
|
|
- Install a specific version of Golang:
|
|
|
|
`goenv install {{go_version}}`
|
|
|
|
- Use a specific version of Golang in the current project:
|
|
|
|
`goenv local {{go_version}}`
|
|
|
|
- Set the default Golang version:
|
|
|
|
`goenv global {{go_version}}`
|
|
|
|
- List all available Golang versions and highlight the default one:
|
|
|
|
`goenv versions`
|
|
|
|
- Uninstall a given Go version:
|
|
|
|
`goenv uninstall {{go_version}}`
|
|
|
|
- Run an executable with the selected Go version:
|
|
|
|
`goenv exec go run {{go_version}}`
|