DEV Community

Cover image for Install Golang using Gobrew
Rusydy
Rusydy

Posted on

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)