简体   繁体   English

为什么命令“ go clean -n -r -igithub.com/ethereum/go-ethereum…”不起作用?

[英]Why command “go clean -n -r -i github.com/ethereum/go-ethereum…” does not work?

What I did were as follows step by step: 我所做的步骤如下:

  1. Git clone go-ethereum project to my local PC. 将Git clone go-ethereum项目复制到我的本地PC。 It is located in D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum. 它位于D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum中。 It is the source code of go-ethereum 这是go-ethereum的源代码

    Note: The OS is windows 7. Go has already been installed. 注意:操作系统是Windows7。已经安装了Go。 And GOPATH env has already been set to "D:\\GOPATH" 并且GOPATH env已经设置为“ D:\\ GOPATH”

  2. cd /d D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum. cd / d D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum。 Then execute "go install". 然后执行“开始安装”。 Some exe files were genereated under D:\\GOPATH\\bin directory, and many pkg file with suffix .a were generated under D:\\GOPATH\\pkg directory. 在D:\\ GOPATH \\ bin目录下生成了一些exe文件,而在D:\\ GOPATH \\ pkg目录下生成了许多带后缀.a的pkg文件。 Everything seems no problem. 一切似乎都没有问题。

  3. Execute "go clean -n -r -i github.com/ethereum/go-ethereum..." to remove all the generated exe files and .a files. 执行“ go clean -n -r -i github.com/ethereum/go-ethereum ...”,删除所有生成的exe文件和.a文件。 But something very interesting happened: 但是发生了一件非常有趣的事情:

In the command's log, it showed that some files are deleted, but actually they are not deleted from disk. 在命令的日志中,它显示了一些文件已删除,但实际上并未从磁盘中删除。

For example, event.a exists under D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum, but the log of "git clean" shows:"rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\event.a" 例如,event.a存在于D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum下,但日志“ git clean”显示为:“ rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ event.a“

The detailed information is in the attached images. 详细信息在随附的图像中。

It is very strange. 这很奇怪。 The log does not match with the actual result: 日志与实际结果不符:

A small segment of go clean command is as follows(since there are more than 1300 lines in log, I can not paste all of it): go clean命令的一小部分如下(由于日志中有1300行以上,因此我无法全部粘贴):

cd D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum\\event cd D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum \\ event
rm -f event.test event.test.exe rm -f event.test event.test.exe
rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\event.a rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ event.a
cd D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum\\common\\mclock cd D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum \\ common \\ mclock
rm -f mclock.test mclock.test.exe rm -f mclock.test mclock.test.exe
rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\common\\mclock.a rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ common \\ mclock.a
cd D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum\\vendor\\github.com\\aristanetworks\\goarista\\monotime cd D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum \\ vendor \\ github.com \\ aristanetworks \\ goarista \\ monotime
rm -f monotime.test monotime.test.exe rm -f monotime.test monotime.test.exe
rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\vendor\\github.com\\aristanetworks\\goarista\\monotime.a rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ vendor \\ github.com \\ aristanetworks \\ goarista \\ monotime.a
cd D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum\\accounts\\abi cd D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum \\ accounts \\ abi
rm -f abi.test abi.test.exe rm -f abi.test abi.test.exe
rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\accounts\\abi.a rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ accounts \\ abi.a
cd D:\\GOPATH\\src\\github.com\\ethereum\\go-ethereum\\accounts\\abi\\bind cd D:\\ GOPATH \\ src \\ github.com \\ ethereum \\ go-ethereum \\ accounts \\ abi \\ bind
rm -f bind.test bind.test.exe rm -f bind.test bind.test.exe
rm -f D:\\GOPATH\\pkg\\windows_amd64\\github.com\\ethereum\\go-ethereum\\accounts\\abi\\bind.a rm -f D:\\ GOPATH \\ pkg \\ windows_amd64 \\ github.com \\ ethereum \\ go-ethereum \\ accounts \\ abi \\ bind.a

But some of the files remain: 但是其中一些文件仍然存在:

在此处输入图片说明

The correct answer is actually provided by @Peter in comment. 正确答案实际上是@Peter在评论中提供的。 As Peter said "The -n flag causes clean to print the remove commands it would execute, but not run them." 正如彼得所说:“ -n标志使clean打印将执行的删除命令,但不运行它们。”

I tried "-x" instead of "-n", and it works well. 我尝试用“ -x”代替“ -n”,并且效果很好。 Thanks Peter. 谢谢彼得。 But you posted your answer in comment section, so I have to post your answer here and close this question. 但是您在答案部分中发布了答案,因此我必须在此处发布您的答案并关闭此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 go-ethereum 安装中创建命令? - Make command in go-ethereum installation? Istanbul-tools安装错误:github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul:重定位目标runtime.support_bmi2未定义 - Istanbul-tools installation error: github.com/ethereum/go-ethereum/crypto/bn256/cloudflare.gfpMul: relocation target runtime.support_bmi2 not defined 如何通过 go-ethereum 创建 eth 帐户? - How can I create eth account via go-ethereum? Go-Ethereum 中的两个未知参数 function - two unknow parameters in Go-Ethereum function 来自 go-ethereum 的智能合约解析问题的事件数据 - Event data from Smart Contract parsing issue with go-ethereum 如何将 AWS 区块链服务与 go-ethereum 一起使用? - How to use the AWS blockchain service with go-ethereum? 没有 abi 的 go-ethereum 编码或解码输入数据 - go-ethereum encoding or decoding input data without abi 使用 glide 安装 go-ethereum 依赖项和tendermint 依赖项 - install go-ethereum dependencies and tendermint dependencies with glide 为什么“去获取github.com/…”行得通,为什么“去获取gopkg.in/…”行不行? - Why doesn't “go get gopkg.in/…” work while “go get github.com/…” OK? 从 go-ethereum 实现 Ethereum Personal_sign (EIP-191) 给出了与 ethers.js 不同的签名 - Implementing Ethereum personal_sign (EIP-191) from go-ethereum gives different signature from ethers.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM