immutable

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 []ImmutableViolation, ignoreSet *util.IgnoreSet)

ReportViolations reports immutable violations using the new pretty formatter

Types

type ImmutableViolation

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

ImmutableViolation represents a mutation of an immutable type @immutable implements reporting.Violation

func CheckImmutable

func CheckImmutable(
	cfg *config.Config,
	pass *analysis.Pass,
	packageAnnotations *annotations.PackageAnnotations,
) []ImmutableViolation

func (ImmutableViolation) GetCode

func (v ImmutableViolation) GetCode() string

GetCode returns the error code for this violation

func (ImmutableViolation) GetMessage

func (v ImmutableViolation) GetMessage() string

GetMessage returns the main error message without formatting

func (ImmutableViolation) GetPos

func (v ImmutableViolation) 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