安裝dlv
服務(wù)器上執(zhí)行go install github.com/go-delve/delve/cmd/dlv
牺丙,或yum install dlv
goland上添加遠(yuǎn)程調(diào)試
goland上添加一個(gè)go build
服務(wù)器啟動(dòng):
/var/log/dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./minio -- -v=5 gateway
然后就會(huì)停下來等待goland啟動(dòng)調(diào)試
goland上啟動(dòng)調(diào)試
設(shè)置斷點(diǎn)冲簿,啟動(dòng)調(diào)試