Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

goland 做网页接口的断点调试

学习go 项目,vscode对go mod的支持不稳定,语法提示时有时无,转换回了goland .习惯用断点的方式调试程序,但是不知道goland如何进行接口和网页的断点调试,网上也搜不到相应的文章.谁能指点一二,或者有相关的资料参考一下,谢谢

func main(){

http.HandleFunc("/",demo)
http.ListenAndServe(":8080",nil)

}

func demo(w http.ResponseWriter, r *http.Request) {
断点 var a=1
断点 var b=2
断点 var c=a+b

fmt.Fprintln(w,c)

}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

我不是很确定 vscode 是否是通过 dlv 来进行调试的,因为我一开始就都装过了,所以没碰到调试的问题,你可以试试看:

go get -v -u github.com/derekparker/delve/cmd/dlv

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...