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

Categories

学习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)

}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...