goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module

IDE编辑器:goland 2020.1

下载链接

现象

goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_第1张图片

原因:

运行文件路径配置错误

解决

  1. edit configurations(编辑配置)
    goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_第2张图片

  2. 修改路径
    goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_第3张图片

  3. 将路径具体到要运行的文件
    goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_第4张图片

  4. 点击ok保存。再次点击“run”执行成功。
    goland报错:go: go.mod file not found in current directory or any parent directory; see ‘go help module_第5张图片

你可能感兴趣的:(go,go,goland)