[英]Why command “go clean -n -r -i github.com/ethereum/go-ethereum…” does not work?
What I did were as follows step by step: 我所做的步骤如下:
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”
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. 一切似乎都没有问题。
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.