Install GoLang in goenv of anyenv

Suddenly there was a possibility that I would use Go language and GoLang for business, so I decided to start studying. Since it is a great deal, I will refrain from creating an environment. I hope it helps someone.

environment

HARD: MBP2015 OS: macOS Catalina 10.15.7

Install anyenv

It is a version control tool for languages that often appear in multiple languages, but there is also a GoLang version, which is goenv. If you try various things, you will get a lot of version control tools, so let's centrally manage them using ʻanyenv. If you try to introduce it later, it will be difficult because it will pass through the path ... If you look up the installation procedure of ʻanyenv, you will find a lot of them, so please refer to that.

Reference: anyenv + macOS environment construction

$ anyenv install -l
  Renv
  crenv
  denv
  erlenv
  exenv
  goenv
  hsenv
  jenv
  jlenv
  luaenv
  nodenv
  phpenv
  plenv
  pyenv
  rbenv
  sbtenv
  scalaenv
  swiftenv
  tfenv

I was able to confirm that there is goenv. Let's install it.

$ anyenv install goenv
/var/folders/jg/bmq8whm12bzbh6rszy2yqbpc0000gn/T/goenv.20201103131148.40785 ~/work/suzuki84g
Cloning https://github.com/syndbg/goenv.git master to goenv...
Cloning into 'goenv'...
remote: Enumerating objects: 106, done.
remote: Counting objects: 100% (106/106), done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 14294 (delta 49), reused 45 (delta 12), pack-reused 14188
Receiving objects: 100% (14294/14294), 2.57 MiB | 1.89 MiB/s, done.
Resolving deltas: 100% (9715/9715), done.
~/work/suzuki84g

Install goenv succeeded!
Please reload your profile (exec $SHELL -l) or open a new session.

Restart the shell with ʻexec $ SHELL -land you're done. I was able to confirm that it was installed withgoenv -v`.

$ goenv -v
goenv 2.0.0beta11

Install GoLang

Reference: Install go with goenv ~ For beginners ~

There are tons of versions that can be installed with goenv install -l. Install what you need. Here, I will put the latest version.

$ goenv install 1.15.3
Downloading go1.15.3.darwin-amd64.tar.gz...
-> https://golang.org/dl/go1.15.3.darwin-amd64.tar.gz
Installing Go Darwin 64bit 1.15.3...
Installed Go Darwin 64bit 1.15.3 to /Users/suzukiyuuki/.anyenv/envs/goenv/versions/1.15.3

$ goenv versions
  1.15.3

From the installation log, I confirmed that 1.15.3 was installed under .anyenv. Next, declare its use globally and take various confirmations. The env command type is aligned and intuitive to use, which is really helpful.

$ goenv global 1.15.3
$ goenv rehash
$ goenv versions
* 1.15.3 (set by /Users/suzukiyuuki/.anyenv/envs/goenv/version)

$ go version
go version go1.15.3 darwin/amd64

$ which go
/Users/suzukiyuuki/.anyenv/envs/goenv/shims/go

It should work with this for the time being. Notice of "Complete" release of "Programming Language Go Complete Introduction" published in Mercari's engineering community seemed to be easy to attach. So I'll try it for the time being. Please let me know if you have any good documentation.

Recommended Posts

Install GoLang in goenv of anyenv
Perform multiple version control of Go with anyenv + goenv
[Golang] Specify an array in the value of map
Golang environment construction [goenv]
Zero padding in Golang
Allow brew install of command line tools made in Python
Install numpy in Visual Studio 2019
Handling of quotes in [bash]
Partial in case of trouble
Clear CloudFront cache in Golang
Combination of anyenv and direnv
Pip install in proxy environment
List of nodes in diagrams
Equivalence of objects in Python
Install multiple versions of Python
Implementation of quicksort in Python
Python install in 2 lines @Windows