use of internal package xxx not allowed after rename the project

457 views Asked by At

I am trying to start my first Go project based on someone else's code, so I download his GitHub repo as zip, upload it to my own repo. Then use go get -u github.com/@username/@repo to install my repo, and add a replace statement to go.mod:

replace someone/repo v4.19.1+incompatible => ./

As a result, when I try go test ./... and go build ./... in the top directory, I get an error saying use of internal package xxx/yyy/internal not allowed. I am sure the only file include import xxx/yyy/internal is at the dir xxx/yyy, which should match the restriction of internal package of Go.

I don't know why go test ./... runs well in the original repo, but fails in my repo. Is there anything else I need to do to modify other people's repo?

Any help is appreciated, thanks!

0

There are 0 answers