Description
Goenv helps you to work with multiple golang versions at the same time whether on mac or linux operating system. It supports both global and per-application version configuration.
Goenv alternatives and similar packages
Based on the "Go Tools" category.
Alternatively, view Goenv alternatives based on common mentions on social networks and blogs.
-
The Go Play Space
Advanced Go Playground frontend written in Go, with syntax highlighting, turtle graphics mode, and more -
Sonic
Sonic is a Go library for network and I/O programming that provides developers with a consistent asynchronous model, with a focus on achieving the lowest possible latency and jitter in Go. -
typex
[TOOL/CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations. -
Viney's go-cache
A flexible multi-layer Go caching library to deal with in-memory and shared cache by adopting Cache-Aside pattern. -
gothanks
GoThanks automatically stars Go's official repository and your go.mod github dependencies, providing a simple way to say thanks to the maintainers of the modules you use and the contributors of Go itself. -
go-lock
go-lock is a lock library implementing read-write mutex and read-write trylock without starvation -
goroutines
It is an efficient, flexible, and lightweight goroutine pool. It provides an easy way to deal with concurrent tasks with limited resource. -
PDF to Image Converter Using Golang
This project will help you to convert PDF file to IMAGE using golang. -
go-james
DISCONTINUED. James is your butler and helps you to create, build, debug, test and run your Go projects -
docs
Automatically generate RESTful API documentation for GO projects - aligned with Open API Specification standard -
rescached
DISCONTINUED. [mirror] Resolver (DNS) cache daemon. See https://sr.ht/~shulhan/rescached [Moved to: https://github.com/shuLhan/rescached] -
modver
Compare two versions of a Go module to check the version-number change required (major, minor, or patchlevel), according to semver rules. -
channelize
A websocket framework to manage outbound streams. Allowing to have multiple channels per connection that includes public and private channels. -
IP2Location.io Command Line
IP2Location.io command line to query IP geolocation data from IP2Location.io API -
IP2Location.io SDK
IP2Location.io Go SDK allows user to query for an enriched data set based on IP address and provides WHOIS lookup api that helps users to obtain domain information.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Goenv or a related project?
README
Goenv Manage Your Applications Go Environment
Goenv helps you to work with multiple golang
versions at the same time whether on mac or linux operating system. It supports both global and per-application version configuration.
Usage
Download the latest goenv
binary. Make it executable from everywhere.
$ export GOENV_LATEST_VERSION=$(curl --silent "https://api.github.com/repos/spacewalkio/Goenv/releases/latest" | jq '.tag_name' | sed -E 's/.*"([^"]+)".*/\1/' | tr -d v)
# For Linux
$ curl -sL https://github.com/spacewalkio/Goenv/releases/download/v{$GOENV_LATEST_VERSION}/goenv_{$GOENV_LATEST_VERSION}_Linux_x86_64.tar.gz | tar xz
# For Mac
$ curl -sL https://github.com/spacewalkio/Goenv/releases/download/v{$GOENV_LATEST_VERSION}/goenv_{$GOENV_LATEST_VERSION}_Darwin_x86_64.tar.gz | tar xz
Configure the goenv using the following command
$ goenv config
Add goenv
shims to PATH
using the following command. also append it to ~/.profile
file to make it permanent.
$ export PATH="$HOME/.goenv/shims:"$PATH
# OR
$ eval "$(goenv init)"
Install a new go
version 1.18
and set as a global
$ goenv install 1.18
$ goenv global 1.18
To configure a local version different from the global
$ goenv local 1.18
To Uninstall a version
$ goenv uninstall 1.18
Show the used version either from current directory or parent directories or the global version.
$ goenv version
To list all installed versions
$ goenv versions
for a list of all available commands
$ goenv --help
๐ Manage Your Applications Go Environment.
If you have any suggestions, bug reports, or annoyances please report
them to our issue tracker at <https://github.com/spacewalkio/goenv/issues>
Usage:
goenv [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
config Configure the goenv application.
exec Show the current go version.
global Set or show the global go version.
help Help about any command
info Print the goenv version
init Init the import path for goenv shims.
install Install a go version.
license Print the license
local Set or show the local application-specific go version.
rehash Refresh binaries under goenv shim directory.
uninstall Uninstall a specific go version.
version Show the current go version.
versions List installed go versions.
Flags:
-h, --help help for goenv
Use "goenv [command] --help" for more information about a command.
Under The Hood
Goenv is inspired by and works like rbenv
. At a high level, goenv
intercepts Go
commands using shim
executables injected into your PATH
, determines which Go version has been specified by your application or globally, and passes your commands to the correct Go
installation bin
folder.
Understanding PATH
When you run a command like go
or gofmt
, your operating system searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called PATH
, with each directory in the list separated by a colon:
/usr/local/bin:/usr/bin:/bin
Directories in PATH
are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the /usr/local/bin
directory will be searched first, then /usr/bin
, then /bin
.
Understanding Shims
goenv
works by inserting a directory of shims at the front of your PATH
:
~/.goenv/shims:/usr/local/bin:/usr/bin:/bin
Through a process called rehashing, goenv
maintains shims in that directory to match every Go
command across every installed version of go
like gofmt
and so on.
shims
are lightweight executables that simply pass your command to the right binary under the current go version, your operating system will do the following:
- Search your
PATH
for an executable file namedgofmt
. - Find the goenv shim named
gofmt
at the beginning of yourPATH
- Run the shim named
gofmt
, which in turn fetch the target go version and use thegofmt
insidego/bin
directory.
Choosing the Go Version
When you execute a shim, goenv
determines which Go version to use by reading it from the following sources, in this order:
- The first
.go-version
file found by searching the current working directory and each of its parent directories until reaching the root of your filesystem. You can modify the.go-version
file in the current working directory with thegoenv local x.x.x
command. - The global
$HOME/.goenv/version
file. You can modify this file using thegoenv global x.x.x
command.
Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Goenv is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.
See the Releases section of our GitHub project for changelogs for each release version of Goenv. It contains summaries of the most noteworthy changes made in each release. Also see the Milestones section for the future roadmap.
Bug tracker
If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/spacewalkio/goenv/issues
Security Issues
If you discover a security vulnerability within Goenv, please send an email to [email protected]
Contributing
We are an open source, community-driven project so please feel free to join us. see the [contributing guidelines](CONTRIBUTING.md) for more details.
License
ยฉ 2022, Clivern. Released under MIT License.
Goenv is authored and maintained by @clivern.
*Note that all licence references and agreements mentioned in the Goenv README section above
are relevant to that project's source code only.