goland出现报错go: go.mod file not found in current directory or any parent directory;

2022-06-21 11:46:24

windows环境下,可使用cmd进入项目文件夹执行: go mod init example.com/greetings
在这里插入图片描述
出现go.mod文件,即可解决此问题

还有出现goland该版本的 %1 与你运行的 Windows 版本不兼容

注意修改代码头部为package main

  • 作者:听风去
  • 原文链接:https://blog.csdn.net/weixin_42491366/article/details/116670076
    更新时间:2022-06-21 11:46:24