【问题标题】:RLock /storage/8D8B-150E/github.com/my-username/App/go.mod: function not implementedRLock /storage/8D8B-150E/github.com/my-username/App/go.mod:功能未实现
【发布时间】:2021-08-10 22:27:48
【问题描述】:

我在使用此命令在 go 中创建新模块时遇到问题:go mod init <moduleName> 它成功创建了 go.mod 文件,但后来抛出此错误 go: RLock /storage/mySdCard/github.com/my-username/App/go.mod: function not implemented 并且它不允许我安装任何 go 包!请帮我解决这个错误或者我该如何解决它!

我运行了这个命令: go mod init myApp

我得到的输出: go: creating new go.mod: module myApp go: updating go.mod: Lock /storage/8D8B-150E/Go/src/github.com/my-username/App/go.mod: function not implemented

【问题讨论】:

  • 我们看不到的代码很难调试。你能用产生错误的代码更新你的问题吗?
  • 每当我尝试在 go 中创建新模块时都会抛出错误!!!顺便说一句,我正在使用 termux!
  • 你刚才说它成功创建了模块。那么成功与否?请显示您运行以产生错误的 eact 命令。

标签: go goland


【解决方案1】:

go 命令使用文件锁定来确保在同时运行多个go 命令时以一致的状态读取go.mod 文件。

您看到的RLock /storage/mySdCard/github.com/my-username/App/go.mod: function not implemented 错误表明包含go.mod 文件(/storage/mySdCard) 的文件系统不支持读锁定。 (在大多数类 Unix 操作系统上,我们使用 flock 系统调用。)

如果您无法将文件系统配置为支持锁定,并且您无法在不同的文件系统中工作,请在https://golang.org/issue/new 提出问题,并提及issue #37461(密切相关) 在问题描述中。

【讨论】:

  • 感谢您的回复:)
猜你喜欢
  • 1970-01-01
  • 2021-03-01
  • 2022-01-12
  • 2021-12-12
  • 2021-04-28
  • 1970-01-01
  • 1970-01-01
  • 2021-03-26
相关资源
最近更新 更多