RLock /storage/8D8B-150E/github.com/my-username/App/go.mod: 功能未实现

huangapple go评论82阅读模式
英文:

RLock /storage/8D8B-150E/github.com/my-username/App/go.mod: function not implemented

问题

我在使用以下命令创建一个新的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

英文:

I am having an issue while creating a new module in go with this command: go mod init &lt;moduleName&gt; it successfully created go.mod file but later then throws this error go: RLock /storage/mySdCard/github.com/my-username/App/go.mod: function not implemented & its not allowing me to install any go packages! Please help me to resolve this error or how can I fix it!!

I ran this command:
go mod init myApp

The output I got:
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

答案1

得分: 7

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(与此问题密切相关)。

英文:

The go command uses file-locking to ensure that the go.mod file is read in a consistent state if you run multiple go commands concurrently.

The RLock /storage/mySdCard/github.com/my-username/App/go.mod: function not implemented error that you're seeing indicates that the filesystem containing the go.mod file (/storage/mySdCard) does not support read-locking. (On most Unix-like operating systems, we use the flock system call.)

If you can't configure the filesystem to support locking and it isn't practical for you to work within a different filesystem that does, please file an issue at https://golang.org/issue/new, and mention issue #37461 (which is closely related) in the issue description.

huangapple
  • 本文由 发表于 2021年8月10日 18:26:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/68725100.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定