go vscode运行go出现go: go.mod file not found in current directory报错

刚刚配置好的vscode环境中运行go语言,会出现这个

go: go.mod file not found in current directory

解决办法,在cmd环境中输入

go env -w GO111MODULE=off

此时再在vscode中启动,就会正常运行

你可能感兴趣的:(golang,golang,vscode,开发语言)