Convert Figma logo to code with AI

go-nv logogoenv

:blue_car: Like pyenv and rbenv, but for Go.

2,050
245
2,050
23

Top Related Projects

16,029

Manage your app's Ruby environment

38,567

Simple Python version management

2,222

Manage multiple NodeJS versions.

2,050

:blue_car: Like pyenv and rbenv, but for Go.

10,106

Go Version Manager

21,553

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more

Quick Overview

goenv is a Go version management tool that allows users to easily switch between different versions of Go on their system. It provides a simple interface for installing, uninstalling, and managing multiple Go versions, making it easier for developers to work on projects that require different Go versions.

Pros

  • Easy installation and setup process
  • Supports multiple Go versions on a single system
  • Integrates well with shell environments (bash, zsh, fish)
  • Allows for project-specific Go version management

Cons

  • Limited to Go version management (doesn't handle dependencies like some other tools)
  • May require manual updates to stay current with new Go releases
  • Potential conflicts with system-wide Go installations if not configured properly
  • Limited cross-platform support compared to some alternatives

Getting Started

  1. Install goenv:

    git clone https://github.com/go-nv/goenv.git ~/.goenv
    
  2. Add goenv to your PATH:

    echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bashrc
    echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(goenv init -)"' >> ~/.bashrc
    
  3. Restart your shell or run:

    source ~/.bashrc
    
  4. Install a Go version:

    goenv install 1.17.0
    
  5. Set a global Go version:

    goenv global 1.17.0
    
  6. Verify the installation:

    go version
    

Competitor Comparisons

16,029

Manage your app's Ruby environment

Pros of rbenv

  • Mature and widely adopted in the Ruby community
  • Extensive plugin ecosystem for additional functionality
  • Lightweight and focused solely on Ruby version management

Cons of rbenv

  • Limited to Ruby language support
  • Requires manual installation of Ruby versions

Code Comparison

rbenv:

# Install Ruby version
rbenv install 3.1.0

# Set global Ruby version
rbenv global 3.1.0

# Set local Ruby version
rbenv local 3.1.0

goenv:

# Install Go version
goenv install 1.18.0

# Set global Go version
goenv global 1.18.0

# Set local Go version
goenv local 1.18.0

Key Differences

  • rbenv is specifically designed for Ruby, while goenv is tailored for Go
  • Both tools follow similar usage patterns for installing and managing versions
  • goenv includes automatic download and installation of Go versions, whereas rbenv requires manual Ruby installation
  • rbenv has a larger community and more extensive documentation due to its longer history
  • goenv is newer and may have fewer plugins or extensions compared to rbenv

Overall, both tools serve similar purposes for their respective languages, with rbenv being more established in the Ruby ecosystem and goenv providing a familiar experience for Go developers.

38,567

Simple Python version management

Pros of pyenv

  • More mature and widely adopted project with a larger community
  • Supports a broader range of Python versions and implementations
  • Offers plugin system for extended functionality

Cons of pyenv

  • Slightly more complex setup process
  • May require additional dependencies depending on the system

Code Comparison

pyenv:

pyenv install 3.9.0
pyenv global 3.9.0
python --version

goenv:

goenv install 1.16.0
goenv global 1.16.0
go version

Both tools follow similar usage patterns, allowing users to install, manage, and switch between different versions of their respective languages. The main difference lies in the specific language ecosystem they cater to (Python vs. Go).

While pyenv offers more features and flexibility due to its longer development history and larger community, goenv provides a simpler, more focused solution for Go developers. pyenv's plugin system allows for additional functionality, but this can also make it more complex for some users. goenv, being newer and more specialized, may have a smoother learning curve for Go-specific version management.

Ultimately, the choice between these tools depends on the specific language ecosystem and individual project requirements.

2,222

Manage multiple NodeJS versions.

Pros of nodenv

  • Supports multiple Node.js versions and automatically switches between them based on project requirements
  • Provides a plugin system for extending functionality
  • Has a larger community and more frequent updates

Cons of nodenv

  • Limited to Node.js version management only
  • May require additional setup for global npm packages

Code Comparison

nodenv:

nodenv install 14.17.0
nodenv global 14.17.0
nodenv local 12.22.1

goenv:

goenv install 1.16.5
goenv global 1.16.5
goenv local 1.15.11

Both tools use similar syntax for installing, setting global, and local versions. The main difference lies in the language-specific versions they manage.

Key Differences

  • Language focus: nodenv is specific to Node.js, while goenv manages Go versions
  • Community size: nodenv has a larger user base and more active development
  • Functionality: goenv is more focused on version management, while nodenv offers additional features through plugins

Use Cases

  • Choose nodenv for Node.js projects with complex version requirements or when working with multiple Node.js versions
  • Opt for goenv when managing Go environments and switching between different Go versions for various projects

Both tools provide similar core functionality for their respective languages, making version management easier for developers working on multiple projects with different language version requirements.

2,050

:blue_car: Like pyenv and rbenv, but for Go.

Pros of goenv

  • Actively maintained with regular updates
  • Supports multiple Go versions and easy switching
  • Integrates well with shell environments

Cons of goenv

  • May require additional setup compared to system-wide Go installation
  • Potential performance overhead due to version management

Code Comparison

goenv:

goenv install 1.16.0
goenv global 1.16.0
goenv local 1.15.0

Additional Notes

Both repositories appear to be the same project, as go-nv/goenv is the main repository for the goenv tool. The comparison provided is between goenv and a standard Go installation rather than two distinct repositories.

goenv is a version management tool for Go, similar to rbenv for Ruby. It allows users to easily switch between different Go versions, which is particularly useful for developers working on multiple projects with varying Go version requirements.

While goenv provides flexibility and version control, it may introduce a slight learning curve for users accustomed to a single system-wide Go installation. However, its benefits in managing multiple Go versions often outweigh this initial setup complexity for many developers and projects.

10,106

Go Version Manager

Pros of gvm

  • Supports multiple Go versions and switching between them
  • Allows creating isolated Go environments (similar to Python's virtualenv)
  • Provides a more comprehensive set of commands for managing Go installations

Cons of gvm

  • Less actively maintained compared to goenv
  • May have compatibility issues with newer Go versions
  • Installation process can be more complex for some users

Code Comparison

gvm:

gvm install go1.16
gvm use go1.16
gvm pkgset create myproject
gvm pkgset use myproject

goenv:

goenv install 1.16.0
goenv global 1.16.0
# No direct equivalent for isolated environments

Key Differences

  • goenv focuses on simplicity and follows the *env pattern (like rbenv, pyenv)
  • gvm offers more features but may be overkill for basic Go version management
  • goenv is more actively maintained and updated regularly
  • gvm provides isolated environments, while goenv relies on Go modules for dependency management

Use Cases

  • Choose gvm if you need isolated environments and more advanced features
  • Opt for goenv if you prefer a simpler, more straightforward Go version manager
  • Consider goenv if you're already familiar with other *env tools (rbenv, pyenv)

Both tools serve the purpose of managing Go versions, but they cater to different user preferences and requirements.

21,553

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more

Pros of asdf

  • Supports multiple programming languages and tools, not just Go
  • Highly extensible through plugins
  • Provides a unified interface for managing versions across different technologies

Cons of asdf

  • Requires installation of plugins for each language/tool
  • May have a steeper learning curve due to its multi-language nature
  • Potentially slower for single-language use cases compared to specialized tools

Code Comparison

asdf:

asdf plugin add golang
asdf install golang 1.16.0
asdf global golang 1.16.0

goenv:

goenv install 1.16.0
goenv global 1.16.0

Key Differences

  • asdf is a general-purpose version manager, while goenv is Go-specific
  • asdf relies on plugins for language support, goenv has built-in Go support
  • asdf uses a unified command structure across languages, goenv uses Go-centric commands
  • asdf may require more setup initially, but offers greater flexibility for multi-language projects
  • goenv provides a more streamlined experience for Go-only development environments

Use Case Recommendations

  • Choose asdf for projects involving multiple programming languages or tools
  • Opt for goenv in Go-centric development environments or for simpler setup in Go-only projects

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Go Version Management: goenv

PR Checks Status Latest Release License Go Bash Linux macOS

goenv aims to be as simple as possible and follow the already established successful version management model of pyenv and rbenv.

New go versions are added automatically on a daily CRON schedule.

This project was cloned from pyenv and modified for Go.

asciicast

goenv does...

  • Let you change the global Go version on a per-user basis.
  • Provide support for per-project Go versions.
  • Allow you to override the Go version with an environment variable.
  • Search commands from multiple versions of Go at a time.

goenv compared to others:


Hints

AWS CodeBuild

The following snippet can be inserted in your buildspec.yml (or buildspec definition) for AWS CodeBuild. It's recommended to do this during the pre_build phase.

Side Note: if you use the below steps, please unset your golang version in the buildspec and run the installer manually.

- BUILD_DIR=$PWD
- cd /root/.goenv/plugins/go-build/../.. && git pull && cd -
- cd $BUILD_DIR

Links