constructor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportViolations

func ReportViolations(pass *analysis.Pass, violations []ConstructorViolation, ignoreSet *util.IgnoreSet)

ReportViolations reports constructor violations using the new pretty formatter

Types

type ConstructorViolation

type ConstructorViolation struct {
	TypeName string
	Reason   string
	Code     string // Error code from codes package
	Pos      token.Pos
	Node     ast.Node
}

ConstructorViolation represents a constructor violation implements reporting.Violation

func CheckConstructor

func CheckConstructor(
	config *config.Config,
	pass *analysis.Pass,
	packageAnnotations *annotations.PackageAnnotations,
) []ConstructorViolation

func (ConstructorViolation) GetCode

func (v ConstructorViolation) GetCode() string

GetCode returns the error code for this violation

func (ConstructorViolation) GetMessage

func (v ConstructorViolation) GetMessage() string

GetMessage returns the main error message without formatting

func (ConstructorViolation) GetPos

func (v ConstructorViolation) GetPos() token.Pos

GetPos returns the position of the violation

Jump to

Keyboard shortcuts

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