Skip to content

Using importas within golangci-lint w/ both no-unaliased and no-extra-aliases fails #15

Open
@johndlong

Description

@johndlong

Looking to leverage both no-unaliased and no-extra-aliased flags in golangci-lint, and end up getting results where un-aliased imports start giving problematic results. Ideally we'd have the restrictions provided by both the flags (consistent, always-defined aliases; rejecting any new aliases that aren't described)

linters-settings:
  importas:
    no-unaliased: true
    no-extra-aliases: true
    alias:
...

Which results in a number of issues, where even standard libraries act as if they have an alias but not in the config:

import "time" has alias "" which is not part of config (importas)
        "time"

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