Skip to content

Add "innertypealias" linter #3490

Open
@leonklingele

Description

@leonklingele

Your feature request related to a problem? Please describe.

The innertypealias linter finds find a type which is an alias for exported same package's type:

package a

import "io"

type T int
type t int

type A = T         // want "A is a alias for T but it is exported type"
type B = t         // OK
type C = io.Writer // OK

func _() {
	type D = T // OK
}

type E T   // OK
type F t   // OK
type g = t // OK

type H = T // OK - it is used as an embedded field
type _ struct{ H }

type I = T // OK - it is used as an embedded field
func _() {
	type _ struct{ I }
}

type _ = T // OK

https://github.com/gostaticanalysis/innertypealias

Describe the solution you'd like.

Describe alternatives you've considered.

Additional context.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementlinter: newSupport new linterno decisionNo decision to fix or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions