You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its pretty solid and has a json file that maps the version wanted, and where the compiled version lives, and so knows where to download and install golang from.
It stores the golang binaries in a file cache, so that is can flip quickly.
Its easy to run both normal golang and use gobrew side by side too.
So I was thinking how cool it might be to have a tiny brew.
It will make it easy to install for very OS, and allows for automation.
All the other installers for tinygo ( scoop, make, etc tc ) can stay the same, because all gobrew does is to be a layer on top.
Basic makefile I use to control it.
# so that gobrew is loaded automagically from dep call.exportPATH:=$(PATH):$(HOME)/.gobrew/current/bin:$(HOME)/.gobrew/bin
# gobrew ( via nothing !! )# https://github.com/kevincobain2000/gobrew/releases/tag/v1.10.10BASE_DEP_BIN_GOBREW_NAME=gobrew
BASE_DEP_BIN_GOBREW_VERSION=v1.10.10
# gobrew versionBASE_DEP_BIN_GOBREW_VERSION_ACTUAL=$(shell$(BASE_DEP_BIN_GOBREW_NAME) version)ifeq ($(BASE_OS_NAME),windows)
BASE_DEP_BIN_GOBREW_NAME=gobrew.exe
endifBASE_DEP_BIN_GOBREW_WHICH=$(shell command -v $(BASE_DEP_BIN_GOBREW_NAME))gobrew-dep:
ifeq ($(BASE_OS_NAME),darwin)
@echo "--- gobrew: darwin ---"
curl -sLk https://raw.githubusercontent.com/kevincobain2000/gobrew/$(BASE_DEP_BIN_GOBREW_VERSION)/git.io.sh | sh
endififeq ($(BASE_OS_NAME),linux)
@echo "--- gobrew: linux ---"
curl -sLk https://raw.githubusercontent.com/kevincobain2000/gobrew/$(BASE_DEP_BIN_GOBREW_VERSION)/git.io.sh | sh
endififeq ($(BASE_OS_NAME),windows)
@echo "--- gobrew: windows ---"
curl -sLk https://raw.githubusercontent.com/kevincobain2000/gobrew/$(BASE_DEP_BIN_GOBREW_VERSION)/git.io.sh | sh
# Below uses Powershell and we dont use powersehll because bash works fine.#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/kevincobain2000/gobrew/master/git.io.ps1'))endif
kicking the tires:
/Users/apple/.gobrew/bin/gobrew -h
[Info] Invalid usage
gobrew 1.10.10
Usage:
gobrew use <version> Install and set<version>
gobrew ls Alias for list
gobrew ls-remote List remote versions (including rc|beta versions)
gobrew install <version> Only install <version> (binary from official or GOBREW_REGISTRY env)
gobrew uninstall <version> Uninstall <version>
gobrew list List installed versions
gobrew self-update Self update this tool
gobrew prune Uninstall all go versions except current version
gobrew version Show gobrew version
gobrew help Show this message
Examples:
gobrew use 1.16 # use go version 1.16
gobrew use 1.16.1 # use go version 1.16.1
gobrew use 1.16rc1 # use go version 1.16rc1
gobrew use 1.16@latest # use go version latest of 1.16
gobrew use 1.16@dev-latest # use go version latest of 1.16, including rc and beta# Note: rc and beta become no longer latest upon major release
gobrew use mod # use go version listed in the go.mod file
gobrew use latest # use go version latest available
gobrew use dev-latest # use go version latest avalable, including rc and beta
Installation Path:
# Add gobrew to your ~/.bashrc or ~/.zshrcexport PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"export GOROOT="$HOME/.gobrew/current/go"``
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have been using gobrew, because it flips the version of golang installed, based on the go.mod version.
https://github.com/kevincobain2000/gobrew
Its pretty solid and has a json file that maps the version wanted, and where the compiled version lives, and so knows where to download and install golang from.
It stores the golang binaries in a file cache, so that is can flip quickly.
Its easy to run both normal golang and use gobrew side by side too.
So I was thinking how cool it might be to have a tiny brew.
It will make it easy to install for very OS, and allows for automation.
All the other installers for tinygo ( scoop, make, etc tc ) can stay the same, because all gobrew does is to be a layer on top.
Basic makefile I use to control it.
kicking the tires:
Beta Was this translation helpful? Give feedback.
All reactions