How to fix parsing go.mod module declares its path as “x” but was required as “y”

I think the problem comes from the fact that the go.mod of your cloned version of original-project still says module github.com/y/original-project. You should use the go.mod replace directive. It is meant for cases like yours exactly.

replace github.com/y/original-project => /path/to/x/my-version

Leave a Comment