創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)BGP香港云服務(wù)器提供商,新人活動買多久送多久,劃算不套路!
VSCode對Golang程序進行調(diào)試時報錯的解決方法?針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
使用VSCode對Golang程序進行調(diào)試時會遇到數(shù)據(jù)截斷問題,string只顯示前64個字符,array只顯示前64個數(shù)據(jù)。經(jīng)查dlv是支持以參數(shù)方式來控制的。
發(fā)現(xiàn)VSCode的Golang插件里面有個叫做go.delveConfig
的配置,是可以設(shè)置dlv參數(shù)的。分享一下我的整個Golang配置:
"go.buildOnSave": "off", "go.formatTool": "goimports", "go.lintTool": "golangci-lint", //go get -u github.com/golangci/golangci-lint/cmd/golangci-lint "go.autocompleteUnimportedPackages": true, "go.gotoSymbol.includeImports": true, "go.useLanguageServer": true, "go.delveConfig": { "dlvLoadConfig": { "followPointers": true, "maxVariableRecurse": 3, "maxStringLen": 1024, "maxArrayValues": 1024, "maxStructFields": -1 }, }, "[go]": { "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": true } },