DEV Community

Yusuke Hatanaka
Yusuke Hatanaka

Posted on • Originally published at Medium on

Preparing the development environment for Go in late 2017

Introduction

  • gvm
  • direnv
  • Go
  • GoLand

gvm

moovweb/gvm

gvm is most popular Go Version Manager as far as I know.
It’s able to switch version of Go in easily.

Install:

% bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
% vi ~/.zshenv
[[-s ~/.gvm/scripts/gvm]] && . ~/.gvm/scripts/gvm
Enter fullscreen mode Exit fullscreen mode

direnv

direnv/direnv

direnv has good compatibility with Go, that can switch GOPATH without care.

Install:

% brew install direnv
% vi ~/.zshenv
[[-f /usr/local/bin/direnv]] && \
  eval “$(direnv hook zsh)”
% vi ~/.direnvrc
use_go(){
 . $GVM_ROOT/scripts/gvm-default
 gvm use $1
}
Enter fullscreen mode Exit fullscreen mode

Go1.9.2

Installing latest Go as binary.

% gvm install go1.9.2 -B
Enter fullscreen mode Exit fullscreen mode

GoLand

GoLand: Capable and Ergonomic Go IDE by JetBrains

GoLand is IDE developed by JetBrains.
It’ll be able to use without tedious settings. (I like also vim-go, but I use this recently, It’s easy)

Getting Started

% mkdir awesome-project
% cd awesome-project
% direnv edit
use go go1.9.2
layout go
Enter fullscreen mode Exit fullscreen mode

Ready to be done!

Top comments (0)