GOLANG package - module declares its path as: something, but required as as: github.com/something
06:31 28 Sep 2026

I know this post look similar to this problem similar problem post.

My problem is, I want to start new big size project, i selected golang which i am learning some time. This project requires more repositories, so i created separate organization on github, in which i want to store modules. I dont like prefixes for modules github.com/username/module, i use organization/project, which is more like readable and i dont need to think about where to store my code (github, gitlab, etc...).

Now i am storing modules in private repositories, but when I want to import them in my project and this is output

go get -v github.com/username/module
go: github.com/username/module requires github.com/username/module: parsing go.mod:
        module declares its path as: organization/module
                but was required as: github.com/username/module

And should be easy, just write it in required format, but if I want to migrate in gitlab i should rewrite every repository, for me it does not sound as best practice.

I want some advice, what should i do.

tooling-recommendation go