Skip to content

Add "constructor" linter #3488

Open
Open
@leonklingele

Description

@leonklingele

Your feature request related to a problem? Please describe.

The constructor linter reports whether name of a constructor like function does not begin "New":

type T1 struct{}

func NewT1() (t *T1) { return } // OK

func CreateT1() (t *T1) { return } // want `name of a constructor like function must begin "New"`

https://github.com/gostaticanalysis/constructor

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