Skip to content

Way to handle duplicate imports of one package? #132

@fasaxc

Description

@fasaxc

I have some files that import the same library package multiple times with different names:

import log "github.com/sirupsen/logrus"
import "github.com/sirupsen/logrus"

I was hoping to write a gopatch to clean these up but I can't seem to do it. This patch on its own

@@
var logrus identifier
@@
-import logrus "github.com/sirupsen/logrus"
+import logrusBar "github.com/sirupsen/logrus"
-logrus
+logrusBar

only matches one of the two imports and I can't seem to control which one it matches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions