Skip to content

How to avoid changing import paths for all source code files when upgrading major versions? #39376

Closed
@hsluoyz

Description

@hsluoyz

In our code, we start to use Go modules for v2. Then we had a breaking change (casbin/casbin#472 (comment)) and based on Semver, we need to bump to v3. But this requires all our source code files to update all import paths from v2 to v3. And it also requires all our users' code that imports our library to change their import paths from v2 to v3. This is very inconvenient. And our users are not happy: casbin/casbin#478 (comment) It not only requires a lot of work for each major release, but also makes the git history looking bad.

For other package managers like npm (node.js) or pip (python), it just needs to update the version in the dependency file, no need to update source code.

Can we have a good solution to avoid changing import paths for all source code files for major version releases?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions