DEV Community

Cover image for Install Golang using Gobrew
Rusydy
Rusydy

Posted on

1

Install Golang using Gobrew

The Go version manager’s name is gobrew, which is inspired by nodebrew.

Install gobrew



curl -sLk https://git.io/gobrew | sh -

export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"

export GOROOT="$HOME/.gobrew/current/go"


Enter fullscreen mode Exit fullscreen mode

to make sure it installed properly:



which go


Enter fullscreen mode Exit fullscreen mode

it should return something like:



/Users/username/.gobrew/current/bin/go


Enter fullscreen mode Exit fullscreen mode

If it returns something else, then try to copy the second and third line into ~/zshrc. Don't forget to source ~/.zshrc.

Install Go



gobrew install 1.19.5 


Enter fullscreen mode Exit fullscreen mode

Set Go version



gobrew use 1.19.5


Enter fullscreen mode Exit fullscreen mode

Uninstall Go



gobrew uninstall 1.19.5


Enter fullscreen mode Exit fullscreen mode

List installed Go versions



gobrew ls


Enter fullscreen mode Exit fullscreen mode

List available Go versions



gobrew ls-remote


Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay