LoginSignup
4
1

More than 3 years have passed since last update.

VScodeでGoをいい感じに設定する

Posted at

Golangのインストール

【Go】MacにGoをインストールする

まずは上記から、golangをインストールします。

VScodeの設定

VScodeをインストール
MacOSでVisual Studio Codeをインストールする手順

VScodeを開きます。
左側のタブの一番下、プラグインタブの検索窓に「go」と打ち”Go”をインストール
スクリーンショット 2019-11-26 18.12.39.png

Command+Shift+Pでコマンドパレットを表示。
>Go:Install/Update Toolsと打って出てくるツール群を最新にします。
入力の左側のセレクターで全て選択肢、OKで自動インストールが始まります。
スクリーンショット 2019-11-26 18.16.57.png

インストールが終わったら、Command + ,で設定を開きます。

'setting.json'に以下の設定を追加します。

setting.json
settings.json
{
    "go.toolsEnvVars": {"GO111MODULE": "on"},
}

まとめ

VScodeでGoを書いていたら、パッケージが見つからないとと出たので、備忘録として書きました。

Happy Hacking :sunglasses: !

4
1
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
4
1