---
# System prepended metadata

title: golang remote debug - dlv
tags: [Golang]

---

---
title: golang remote debug - dlv
---
# golang remote debug - dlv
###### tags: `Golang`

官網:
---
https://github.com/go-delve/delve/tree/master/Documentation/installation

安裝
---
把這個垃圾安裝在某個地方，ex： /home/ubuntu/dlv/這裡

golnag安裝
---
![](https://i.imgur.com/Wpxgk1p.png)

防火牆設定
---
linux, aws等 打開設定的port，ex:2345

dlv 執行
---
移動到要執行的程式路徑，先指定dlv這個垃圾的絕對路徑，再接golang提示的 dlv debug --headless --listen=:2345 --api-version=2

所以會是:
/home/ubuntu/go/bin/dlv debug --headless --listen=:2345 --api-version=2

golang執行
---
使用剛設定好的remote，啟動debug mode


go: go.mod file not found in current directory or any parent directory； see ‘go help modules‘
---
https://blog.csdn.net/love_parents/article/details/120006671