闅忕潃浜掕仈緗戞椂浠g殑椋為熷彂灞曪紝鎴戜滑緙栫爜浣跨敤鐨勫紑鍙戝埄鍣ㄤ篃鍦ㄤ笉鏂洿鏂版崲浠o紝鍙よ瘽璇村伐嬈插杽鍏朵簨蹇呭厛鍒╁叾鍣ㄣ傚浜嶨o璇█紼嬪簭鐨勫紑鍙戣呰岃█錛屽綋涓嬫渶鐏殑IDE搴旇闈炲井杞殑Visual Studio Code鑾睘錛屼笅闈㈢粰鍑烘庢牱鍦╲scode涓皟璇昰o紼嬪簭鐨勮繃紼嬶紝浠ac鏈負紺轟緥銆?br />
褰撳墠宸茬粡鍑嗗濂絞o鐨勫緟璋冭瘯浠g爜錛宮ain.go鐨勫嚱鏁頒綅緗負錛?br />
/Users/tingfeng/Workspace/go/src/github.com/nsharecome/caccount/main.go
1銆佺紪杈憀aunch.json鏂囦歡

{
// 浣跨敤 IntelliSense 浜嗚В鐩稿叧灞炴с?nbsp;
// 鎮仠浠ユ煡鐪嬬幇鏈夊睘鎬х殑鎻忚堪銆?br />
// 嬈蹭簡瑙f洿澶氫俊鎭紝璇瘋闂? https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "go",
"request": "launch",
"mode": "debug",
"port": 8899,
"host": "127.0.0.1",
"program": "/Users/tingfeng/Workspace/go/src/github.com/nsharecome/caccount/main.go",
"env": {},
"args": [ ],
"output": "${workspaceRoot}/bin/debug_caccount",
"showLog": true
},
]
}
2銆佺偣鍑昏繍琛岋紝鎶ラ敊濡備笅錛?br />
2021/02/07 16:51:52 /Users/tingfeng/Workspace/go/src/github.com/nsharecome/caccount/main.go/debugger.go:101: launching process with args: [/Users/tingfeng/Workspace/go/src/github.com/nsharecome/caccount/bin/debug_caccount]
could not launch process: decoding dwarf section info at offset 0x0: too short
Process exiting with code: 1
閿欒鍘熷洜濡備笅錛?a title="瀹夎delve">瀹夎delve
瑙e喅鏂瑰紡錛?br />
git clone https://github.com/go-delve/delve.git $GOPATH/src/github.com/go-delve/delve
go get -u github.com/derekparker/delve/cmd/dl
鍒╃敤delve鎵嬪姩璋冭瘯鍙互鍙傝冿細

]]>