Skip to content

versioned package imports #28

@shaneHowearth

Description

@shaneHowearth

When importing version 2 or above of a Go module there's a bit of problem with imports that needs clarifying.

https://go.dev/blog/v2-go-modules

If I have

import (
   foo "github.com/example/foo/v2"
)

The alias is flagged because the package and the path are not matching , that is foo andv2 are clearly not the same.

foov2 doesn't match either

v2 on its own isn't a good package alias.

Is there a nicer way (instead of listing exclusions in the config) of 'fixing' this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions