go项目在VScode中运行发生:undefined错误

go项目在VScode中运行发生:undefined错误

刚学习golang,想尝试运行一个简单的go聊天室项目,在go run main.go之后却报错:
go项目在VScode中运行发生:undefined错误
项目目录如下
go项目在VScode中运行发生:undefined错误
检查一下,环境搭建是没问题的。

因为目录下的go项目有多个,之后又尝试了go run *.go编译运行所有方法,又有以下报错:
go项目在VScode中运行发生:undefined错误
在经过搜索之后,发现可以直接go build,产生一个二进制文件server.exe,运行以下就好了。
go项目在VScode中运行发生:undefined错误
完美运行!yeah!!!