LoginSignup
0
0

More than 1 year has passed since last update.

GoLandでGOROOTとGOPATHを設定する(anyenv, goenv使用)

Posted at

概要

Golandを使用したGOROOTとGOPATHの設定をします。
プロジェクト内で go install をする前に設定しましょう。

はじめに

anyenvでgoenvが使える状態にします。
Goバージョン1.17.2を使用

% anyenv install goenv
% goenv install 1.17.2
% goenv local 1.17.2

GoLand 2022.1.3を使用

「File」→「Preferences」→「Go」

で設定へ進みます。

GOROOT(Go SDK)

/Users/hoge/.anyenv/envs/goenv/versions/X.X.Xを指定します。

GOPATH

/Users/hoge/go/1.17.2を指定します。

終わり

以上で設定終わりです。
go install hoge など行い、パッケージが正しく読み込まれているか確認してみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0