no_constructor_return

package
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoConstructorReturnRule = rule.CreateRule(rule.Rule{
	Name: "no-constructor-return",
	Run: func(ctx rule.RuleContext, options any) rule.RuleListeners {
		return rule.RuleListeners{

			ast.KindReturnStatement: func(node *ast.Node) {
				if isReturnStatementInConstructor(node) {
					ctx.ReportNode(node, buildUnexpectedMessage())
				}
			},
		}
	},
})

NoConstructorReturnRule disallows returning values in constructors

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL