LoginSignup
0
0

More than 5 years have passed since last update.

vscodeのgolangのdebugで詰まった話

Posted at

要約

vscodeでgolangデバッグしようと思ったら、localhostがnot such hostと言われ詰んでたら、hostファイルにlocalhostがなかったというアホすぎるお話。

vscode

jetbrain社のintelliJ使ってるからgoもkotlinもdebugモードで実行できるけど、学生終えて有料になった時の事を考えてvscode使いになろうと思った。

delve

vscodeでgolangデバッグするには、vscodeの拡張機能とgoのパッケージdelveをgo getする必要がある。割愛。

debugモード

ブレークポイント作ってそこでプログラムを止めて変数の中身を見れる。最強。

エラー内容

なんかエラー吐いてた

couldn't launch process: listen tcp: localhost :not such host

的な感じだった。スクショ撮り忘れてうろ覚え。

解決策

まさかのhostファイルが真っ白だった
vim /private/etc/hostsに127.0.0.1 localhost を追記
無事解決。

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