0

What I did were as follows step by step:

  1. Git clone go-ethereum project to my local PC. It is located in D:\GOPATH\src\github.com\ethereum\go-ethereum. It is the source code of go-ethereum

    Note: The OS is windows 7. Go has already been installed. And GOPATH env has already been set to "D:\GOPATH"

  2. 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. 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. 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"

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):

cd D:\GOPATH\src\github.com\ethereum\go-ethereum\event
rm -f event.test event.test.exe
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
rm -f mclock.test mclock.test.exe
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
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
cd D:\GOPATH\src\github.com\ethereum\go-ethereum\accounts\abi
rm -f abi.test abi.test.exe
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
rm -f bind.test bind.test.exe
rm -f D:\GOPATH\pkg\windows_amd64\github.com\ethereum\go-ethereum\accounts\abi\bind.a

But some of the files remain:

enter image description here

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Lin Corey
  • 141
  • 11
  • OK, it is my first time to ask question in stackoverflow, so I am not very familiar with it. – Lin Corey Sep 18 '18 at 06:01
  • 1
    "The -n flag causes clean to print the remove commands it would execute, but not run them." – Peter Sep 18 '18 at 06:44
  • Thank you very much. @Peter I asked a silly question. Just now I tried -x and it works. I will close this question. – Lin Corey Sep 18 '18 at 06:58

1 Answers1

-1

The correct answer is actually provided by @Peter in comment. As Peter said "The -n flag causes clean to print the remove commands it would execute, but not run them."

I tried "-x" instead of "-n", and it works well. Thanks Peter. But you posted your answer in comment section, so I have to post your answer here and close this question.

Lin Corey
  • 141
  • 11