go - 无法更新包(转到 : error loading module requirements)

标签 go

我想更新我的包,但是当我运行 -v 命令以获取最新更新时,命令行出现错误

go get -v ./...

会发生什么?

> go: finding github.com/aws/aws-sdk-go v1.17.11 go: finding
> github.com/aws/aws-sdk-go v1.17.7 go: finding
> github.com/aws/aws-sdk-go v1.16.32 go:
> github.com/aws/aws-sdk-go@v1.17.7: git -c protocol.version=0 fetch
> --unshallow -f https://github.com/aws/aws-sdk-go refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in
> /Users/fly/go/pkg/mod/cache/vcs/cb1953cbdfd14fc2ffce4dfd06487e8d5a0c96da00d00bdef65874ff644eaa26:
> exit status 128:  warning: redirecting to
> https://github.com/aws/aws-sdk-go/    fatal: Unable to create
> '/Users/fly/go/pkg/mod/cache/vcs/cb1953cbdfd14fc2ffce4dfd06487e8d5a0c96da00d00bdef65874ff644eaa26/shallow.lock':
> File exists.
> 
>   Another git process seems to be running in this repository, e.g.    an
> editor opened by 'git commit'. Please make sure all processes     are
> terminated then try again. If it still fails, a git process   may have
> crashed in this repository earlier:   remove the file manually to
> continue. go: github.com/aws/aws-sdk-go@v1.16.32: unknown revision
> v1.16.32 go: github.com/aws/aws-sdk-go@v1.17.11: unknown revision
> v1.17.11 go: error loading module requirements

最佳答案

这里的错误信息很清楚:

Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again.

当您运行 go get 时,git 命令用于加载所有内容。所以还有一个使用git的进程。

只需结束另一个 git 命令,它就会工作。

关于go - 无法更新包(转到 : error loading module requirements),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55205554/

相关文章:

go - 接口(interface)内反射阵列

go - byte slice 操作

终端上的golang简单静态服务器打印

go - 如何在 Go Lang 中将实体附加到数据存储

go - 重启单元文件时的模式和 channel 应该是什么

apache - 通过 'compiling on the fly' 从源代码在 Apache 下运行一个 .go 文件

image - 戈朗 : print text in the image

inheritance - 如何将 'child' 结构传递给接受 'parent' 结构的函数?

go - 调用通过插件导入的结构的函数

docker - 无法安装 golint 包 : wrong import path