-1

I am repeatedly getting this error while trying to fix my go.mod file.

go: github.com/myuser/myfork/banana/potato imports
        github.com/myuser/myfork/apple: github.com/myuser/myfork@v1.0.0: parsing go.mod:
        module declares its path as: github.com/originaluser/originalproject
                but was required as: github.com/myuser/myfork

I have tried deleting both go.mod and go.sum and running go mod init, but the issue persists. I have also cleaned my cache with go clean -modcache multiple times. There are no references to the original project in my files, yet the issue persists.

  • 1
    It sounds like you forked a project and left the module name the same in the new go.mod. The module name in your new fork needs to be updated to `github.com/myuser/myfork`. – Corey Ogburn Aug 03 '23 at 20:55
  • @CoreyOgburn I just checked and the module name is updated on the new go.mod, so I don't think that's the issue – Aline Amorim Aug 03 '23 at 21:07
  • 1
    "module declares it's path as" mean that name is declared in `go.mod`. You probably have a `v1.0.0` tag pointing at the old version. – JimB Aug 03 '23 at 21:17

0 Answers0