Skip to content

gostaticanalysis/constructor

Repository files navigation

constructor PkgGoDev

constructor constructor reports whether name of a constructor like function does not begin "New".

A constructor like function:

  • Requests named struct type or its pointer
  • Requests one or two value, last value must be an error
  • Exported function and it is not method
type T1 struct{}

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

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages