win10使用vscode运行go代码时候报的错,如果是使用终端不会报错,可以正常运行,但是如果使用vscode的Run就会报下面的错误
Build Error: go build -o E:\go_test\sample-app\__debug_bin3021797999.exe -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.mod,小白找了一下解决办法:通过go mod init 项目名命令在项目下创建一个go.mod就可以了,参考:go语言在vscode中报错Build Error