網頁

2020年5月3日 星期日

Go 小教室 - 如何讓mac 上的 goenv 可以選擇 1.12 以上版本


go 其實還一個很年輕的語言,所以每次升級,難免會有一些 breaking change,像最近從 1.13 升級到 1.14 就莫名的讓幾個 unit test 掛了,在還沒有時間去研究到底為什麼升版會造成 unit test 掛掉前,最好還是乖乖定版在 1.13,於是想說就灌個 goenv 來使用,沒想到用 homebrew 安裝的 goenv 卻只能安裝到 1.12beta





$ goenv install -l
Available versions:
  [...]
  1.10.7
  1.11.0
  1.11beta2
  1.11beta3
  1.11rc1
  1.11rc2
  1.11.1
  1.11.2
  1.11.3
  1.11.4
  1.12beta1


研究了一下,作者已經很久沒用 Mac 了,現在要整進 Homebrew 也遇到了問題(Open Source 的宿命):goenv v2.0.0 releases & Homebrew

看到大家七嘴八舌的在討論 workaround 解法,參考討論串上的解法:



brew install jq
if [ -n "$(brew info --json goenv | jq -r '.[0].installed[] | select(.version | test("^HEAD-") | not)')" ]; then
  brew uninstall goenv
fi
brew install --HEAD goenv


另外也有看到日本網友的解法: goenvでGo1.13.6をインストールメモ

拋磚引玉之 Update,感謝威廉推薦的 asdf ,一次解決我要灌許多版本的問題!! 甚至還可以看到許多以前沒看過的好用軟體

asdf plugin list all
1password                  https://github.com/samtgarson/asdf-1password.git
R                          https://github.com/iroddis/asdf-R.git
adr-tools                  https://gitlab.com/td7x/asdf/adr-tools.git
aks-engine                 https://github.com/robsonpeixoto/asdf-aks-engine.git
alp                        https://github.com/asdf-community/asdf-alp.git
argo                       https://github.com/sudermanjr/asdf-argo.git
argocd                     https://github.com/beardix/asdf-argocd.git
aria2                      https://github.com/asdf-community/asdf-aria2.git
asciidoctorj               https://github.com/gliwka/asdf-asciidoctorj.git
bat                        https://gitlab.com/wt0f/asdf-bat.git
bazel                      https://github.com/rajatvig/asdf-bazel.git
binnacle                   https://github.com/Traackr/asdf-binnacle.git
bitwarden                  https://github.com/vixus0/asdf-bitwarden.git
brig                       https://github.com/Ibotta/asdf-brig.git
caddy                      https://github.com/salasrod/asdf-caddy.git
ccache                     https://github.com/asdf-community/asdf-ccache.git
cf                         https://github.com/mattysweeps/asdf-cf.git
chicken                    https://github.com/evhan/asdf-chicken.git
clojure                    https://github.com/halcyon/asdf-clojure.git
cmake                      https://github.com/srivathsanmurali/asdf-cmake.git
concourse                  https://github.com/mattysweeps/asdf-concourse.git
conduit                    https://github.com/gmcabrita/asdf-conduit.git
conform                    https://github.com/skyzyx/asdf-conform.git
conftest                   https://github.com/looztra/asdf-conftest.git
consul                     https://github.com/Banno/asdf-hashicorp.git
coq                        https://github.com/gingerhot/asdf-coq.git
crystal                    https://github.com/asdf-community/asdf-crystal.git
cue                        https://github.com/asdf-community/asdf-cue.git
dart                       https://github.com/PatOConnor43/asdf-dart.git
deno                       https://github.com/asdf-community/asdf-deno.git
dep                        https://github.com/paxosglobal/asdf-dep.git
desk                       https://github.com/endorama/asdf-desk.git
dhall                      https://github.com/aaaaninja/asdf-dhall.git
digdag                     https://github.com/jtakakura/asdf-digdag.git
direnv                     https://github.com/asdf-community/asdf-direnv.git
dive                       https://github.com/looztra/asdf-dive.git
dmd                        https://github.com/sylph01/asdf-dmd.git
docker-slim                https://github.com/everpeace/asdf-docker-slim.git
doctl                      https://github.com/maristgeek/asdf-doctl.git
dotnet-core                https://github.com/emersonsoares/asdf-dotnet-core.git
dotty                      https://github.com/vic/asdf-dotty.git
draft                      https://github.com/kristoflemmens/asdf-draft.git
eksctl                     https://github.com/elementalvoid/asdf-eksctl.git
elasticsearch              https://github.com/asdf-community/asdf-elasticsearch.git
elixir                     https://github.com/asdf-vm/asdf-elixir.git
elm                        https://github.com/asdf-community/asdf-elm.git
erlang                     https://github.com/asdf-vm/asdf-erlang.git
esy                        https://github.com/asdf-community/asdf-esy.git
etcd                       https://github.com/particledecay/asdf-etcd.git
fd                         https://gitlab.com/wt0f/asdf-fd.git
firebase                   https://github.com/jthegedus/asdf-firebase.git
flutter                    https://github.com/oae/asdf-flutter.git
fluxctl                    https://github.com/stefansedich/asdf-fluxctl.git
gauche                     https://github.com/sakuro/asdf-gauche.git
gcloud                     https://github.com/jthegedus/asdf-gcloud.git
ghq                        https://github.com/kajisha/asdf-ghq.git
github-cli                 https://github.com/bartlomiejdanek/asdf-github-cli.git
github-markdown-toc        https://github.com/skyzyx/asdf-github-markdown-toc.git
gleam                      https://github.com/vic/asdf-gleam.git
gohugo                     https://bitbucket.org/mgladdish/asdf-gohugo.git
golang                    *https://github.com/kennyp/asdf-golang.git
golangci-lint              https://github.com/hypnoglow/asdf-golangci-lint.git
graalvm                    https://github.com/vic/asdf-graalvm.git
gradle                     https://github.com/rfrancis/asdf-gradle.git
grails                     https://github.com/weibemoura/asdf-grails.git
groovy                     https://github.com/weibemoura/asdf-groovy.git
guile                      https://github.com/indiebrain/asdf-guile.git
hadolint                   https://github.com/looztra/asdf-hadolint.git
haskell                    https://github.com/vic/asdf-haskell.git
haxe                       https://github.com/asdf-community/asdf-haxe.git
helm                      *https://github.com/Antiarchitect/asdf-helm.git
helm-cr                    https://github.com/Antiarchitect/asdf-helm-cr.git
helmfile                   https://github.com/feniix/asdf-helmfile.git
heptio-authenticator-aws   https://github.com/neerfri/asdf-heptio-authenticator-aws.git
hub                        https://github.com/vixus0/asdf-hub.git
idris                      https://github.com/vic/asdf-idris.git
imagemagick                https://github.com/mangalakader/asdf-imagemagick.git
io                         https://github.com/mracos/asdf-io.git
istioctl                   https://github.com/rafik8/asdf-istioctl.git
java                      *https://github.com/halcyon/asdf-java.git
jmespath                   https://github.com/skyzyx/asdf-jmespath.git
jq                         https://github.com/focused-labs/asdf-jq.git
jsonnet                    https://github.com/Banno/asdf-jsonnet.git
julia                      https://github.com/rkyleg/asdf-julia.git
jx                         https://github.com/vbehar/asdf-jx.git
k6                         https://github.com/grimoh/asdf-k6.git
k9s                       *https://github.com/looztra/asdf-k9s.git
kind                       https://github.com/johnlayton/asdf-kind.git
kops                       https://github.com/Antiarchitect/asdf-kops.git
kotlin                     https://github.com/missingcharacter/asdf-kotlin.git
kscript                    https://github.com/edgelevel/asdf-kscript.git
ksonnet                    https://github.com/Banno/asdf-ksonnet.git
kube-capacity              https://github.com/looztra/asdf-kube-capacity.git
kubectl                    https://github.com/Banno/asdf-kubectl.git
kubectl-bindrole           https://github.com/looztra/asdf-kubectl-bindrole.git
kubectx                    https://gitlab.com/wt0f/asdf-kubectx.git
kubefedctl                 https://github.com/kvokka/asdf-kubefedctl.git
kubeseal                   https://github.com/stefansedich/asdf-kubeseal.git
kubesec                    https://github.com/vitalis/asdf-kubesec.git
kubeval                    https://github.com/stefansedich/asdf-kubeval.git
kustomize                  https://github.com/Banno/asdf-kustomize.git
lean                       https://github.com/asdf-community/asdf-lean.git
lfe                        https://github.com/vic/asdf-lfe.git
logtalk                    https://github.com/LogtalkDotOrg/asdf-logtalk.git
lua                        https://github.com/Stratus3D/asdf-lua.git
luaJIT                     https://github.com/smashedtoatoms/asdf-luaJIT.git
maven                      https://github.com/halcyon/asdf-maven.git
mc                         https://github.com/penpyt/asdf-mc.git
meson                      https://github.com/asdf-community/asdf-meson.git
micronaut                  https://github.com/weibemoura/asdf-micronaut.git
mill                       https://github.com/vic/asdf-mill.git
minikube                   https://github.com/alvarobp/asdf-minikube.git
minio                      https://github.com/aeons/asdf-minio.git
mkcert                     https://github.com/salasrod/asdf-mkcert.git
mlton                      https://github.com/asdf-community/asdf-mlton.git
mongodb                    https://github.com/sylph01/asdf-mongodb.git
mysql                      https://github.com/iroddis/asdf-mysql.git
neko                       https://github.com/asdf-community/asdf-neko.git
neovim                     https://github.com/richin13/asdf-neovim.git
nim                        https://github.com/rfrancis/asdf-nim.git
ninja                      https://github.com/asdf-community/asdf-ninja.git
nodejs                    *https://github.com/asdf-vm/asdf-nodejs.git
nomad                      https://github.com/Banno/asdf-hashicorp.git
ocaml                      https://github.com/asdf-community/asdf-ocaml.git
opam                       https://github.com/asdf-community/asdf-opam.git
openresty                  https://github.com/smashedtoatoms/asdf-openresty.git
operator-sdk               https://github.com/Medium/asdf-operator-sdk.git
packer                     https://github.com/Banno/asdf-hashicorp.git
php                        https://github.com/asdf-community/asdf-php.git
pluto                      https://github.com/FairwindsOps/asdf-pluto.git
poetry                     https://github.com/crflynn/asdf-poetry.git
postgres                   https://github.com/smashedtoatoms/asdf-postgres.git
protoc                     https://github.com/paxosglobal/asdf-protoc.git
pulumi                     https://github.com/canha/asdf-pulumi.git
python                    *https://github.com/danhper/asdf-python.git
racket                     https://github.com/vic/asdf-racket.git
rancher                    https://github.com/abinet/asdf-rancher.git
rbac-lookup                https://github.com/looztra/asdf-rbac-lookup.git
rclone                     https://github.com/johnlayton/asdf-rclone.git
rebar                      https://github.com/Stratus3D/asdf-rebar.git
reckoner                   https://github.com/mjhuber/asdf-reckoner.git
redis                      https://github.com/smashedtoatoms/asdf-redis.git
redskyctl                  https://github.com/sudermanjr/asdf-redskyctl.git
reg                        https://github.com/looztra/asdf-reg.git
riak                       https://github.com/smashedtoatoms/asdf-riak.git
riff                       https://github.com/abinet/asdf-riff.git
ripgrep                    https://gitlab.com/wt0f/asdf-ripgrep.git
rke                        https://github.com/particledecay/asdf-rke.git
rlwrap                     https://github.com/asdf-community/asdf-rlwrap.git
ruby                      *https://github.com/asdf-vm/asdf-ruby.git
rust                       https://github.com/code-lever/asdf-rust.git
sbcl                       https://github.com/smashedtoatoms/asdf-sbcl.git
sbt                        https://github.com/bram2000/asdf-sbt.git
scala                      https://github.com/mtatheonly/asdf-scala.git
scenery                    https://github.com/skyzyx/asdf-scenery.git
serf                       https://github.com/Banno/asdf-hashicorp.git
shellcheck                 https://github.com/luizm/asdf-shellcheck.git
shfmt                      https://github.com/luizm/asdf-shfmt.git
skaffold                   https://github.com/kristoflemmens/asdf-skaffold.git
solidity                   https://github.com/refillic/asdf-solidity.git
sops                       https://github.com/feniix/asdf-sops.git
spark                     *https://github.com/joshuaballoch/asdf-spark.git
sqlite                     https://github.com/cLupus/asdf-sqlite.git
starship                   https://github.com/grimoh/asdf-starship.git
stern                      https://github.com/looztra/asdf-stern.git
swift                      https://github.com/fcrespo82/asdf-swift.git
swiftlint                  https://github.com/klundberg/asdf-swiftlint.git
swiprolog                  https://github.com/mracos/asdf-swiprolog.git
talos                      https://github.com/particledecay/asdf-talos.git
tanka                      https://github.com/trotttrotttrott/asdf-tanka.git
terraform                 *https://github.com/Banno/asdf-hashicorp.git
terraform-docs             https://github.com/looztra/asdf-terraform-docs.git
terraform-validator        https://github.com/looztra/asdf-terraform-validator.git
terragrunt                 https://github.com/lotia/asdf-terragrunt.git
tflint                     https://github.com/skyzyx/asdf-tflint.git
tfsec                      https://github.com/woneill/asdf-tfsec.git
tilt                       https://gitlab.com/wt0f/asdf-tilt.git
tmux                       https://github.com/aphecetche/asdf-tmux.git
trdsql                     https://github.com/johnlayton/asdf-trdsql.git
tridentctl                 https://github.com/superbrothers/asdf-tridentctl.git
v                          https://github.com/ndac-todoroki/asdf-v.git
vault                      https://github.com/Banno/asdf-hashicorp.git
velero                     https://github.com/looztra/asdf-velero.git
yarn                       https://github.com/twuni/asdf-yarn.git
yq                        *https://github.com/sudermanjr/asdf-yq.git
zig                        https://github.com/cheetah/asdf-zig.git
zola                       https://github.com/salasrod/asdf-zola.git





2 則留言: