mac vscode go 语言调试:
目前Go语言支持GDB、LLDB和Delve几种调试器。其中GDB是最早支持的调试工具,LLDB是macOS系统推荐的标准调试工具。但是GDB和LLDB对Go语言的专有特性都缺乏很大支持,而只有Delve是专门为Go语言设计开发的调试工具。而且Delve本身也是采用Go语言开发,对Windows平台也提供了一样的支持。
按照这个https://blog.csdn.net/love666666shen/article/details/88887086方案安装好delve,并开始按F5调试,报一下错误:
Build Error: go buildo/var/folders/hl/q6j6nscx09178szll_72kvym0000gn/T/ __debug_bin1419397486 -gcflags all=-N -l .
go: go.mod file not found in current directory or any parent directory; see ‘go help modules’ (exit status 1)
解决方法:
在终端命令行输入:
go env -w GO111MODULE=off