Skip to content

Flag unused exported names from internal package #6144

@ianb-mp

Description

@ianb-mp

Welcome

How did you install golangci-lint?

go install

Your feature request related to a problem? Please describe

It would be good to flag names (var, const etc) that are exported from an internal package (i.e. reside under internal/) that are unused.

I understand that it's not possible to know whether an exported name is used outside a regular package, but in the case where the package is under internal/, given the special meaning of that directory, it seems that this should be checked.

Describe the solution you'd like

linter should flag unused, exported names in packages that reside under internal/.

Describe alternatives you've considered

I tried the deadcode utility but it doesn't handle this either.

Additional context

No response

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions