0
0

Goの標準ライブラリでuse of internal packageエラーが大量発生した場合の対処方法

Posted at

背景

Go言語のソースコードをVSCodeで閲覧時、大量のuse of internal packageエラーが発生しました。なんとその数3,000以上・・・!
image.png

対処方法

settings.jsonでgorootをcloneしたGoのソースコードのパスに設定をしたら解決しました。
image.png

通常はinternal directoryはinternal directoryと同階層以下にいないと参照できませんが、$GOROOT/src配下の標準ライブラリは$GOROOT/src配下のinternal directoryをどこからでも参照できるようです。

internal directoryの詳細に以下記載がありました。

image.png

※ internal directoryの詳細はhttps://pkg.go.dev/cmd/go#hdr-Internal_Directories から辿りました

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