1
0

【VScode】Go言語で定義元にジャンプできないときの解決方法

Last updated at Posted at 2024-01-04

解決方法①

setting.jsonに次のコードを追加。

"go.useLanguageServer": true,

解決方法②

vscodeの拡張機能「Go」を入れた後に、

command + shift + Pで「Go Install/Updates」を選択し、全てのチェックボックスにチェックを入れてupdate!

image.png

image.png

定義元にジャンプできるようになりました。

解決方法③

goplsをダウンロードした際に、次のようなエラーが出た場合、Goのバージョンが違うのでHomebrewなどを利用してアプリケーションで設定しているGoと同じバージョンをインストールしてください。

Failed to run "go env env,-json,GOMOD": Command failed: /opt/homebrew/bin/go env -json GOMOD go: downloading go1.23 (darwin/arm64) go: download go1.23 for darwin/arm64: toolchain not available
1
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
1
0