我想更新我的软件包,但是当我运行-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
答案 0 :(得分:2)
错误消息在这里很清楚:
此存储库中似乎正在运行另一个git进程,例如一个 编辑器由“ git commit”打开。请确保所有过程 终止,然后重试。
运行go get
时,git
命令用于加载所有内容。因此,还有另一个使用git的过程。
只需结束另一个git命令,它将起作用。