Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when do command go fmt #682

Closed
Patrick0308 opened this issue Jul 30, 2020 · 4 comments
Closed

Error when do command go fmt #682

Patrick0308 opened this issue Jul 30, 2020 · 4 comments
Assignees

Comments

@Patrick0308
Copy link
Contributor

What happened:
When do go fmt ./... && [[ -z git status -s ]] will error
image

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

@AlexStocks
Copy link
Contributor

cc @gaoxinge

@gaoxinge
Copy link

我暂时无法在下面的环境下重现这个问题:

我看你的报错里面访问了库,这个库在go mod中缓存pkg/mod/cache/vcs里面,要不清除go mod的缓存试一下。

@Patrick0308

@Patrick0308 Patrick0308 mentioned this issue Aug 3, 2020
@gaoxinge gaoxinge self-assigned this Aug 8, 2020
@gaoxinge
Copy link

gaoxinge commented Aug 8, 2020

调查了一下这个报错,得到以下结果:

  • 不知道为什么我的电脑上能跑,照理来说应该也会报错,因为我也没有bzr命令,手动狗头
  • bzr是类似git的版本控制工具。早期的launchpad.net/gocheck是基于bzr管理的,根据官网的说法现在已经迁移到了github上,地址位于go-check/check
  • hashicorp/consul/blob/v1.8.0/go.mod自身也使用replacebzr替换成了git的版本

结论:

  • @Patrick0308 你有空帮我测一下下面的命令在你本地能不能跑:
go mod edit -replace launchpad.net/gocheck=github.com/go-check/check@v0.0.0-20140225173054-eb6ee6f84d0a
go mod tidy 
go mod vendor

@gaoxinge gaoxinge mentioned this issue Aug 8, 2020
@gaoxinge
Copy link

I have fixed this issue in #702.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants