Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "gocapsule", Doc: "enforces encapsulation by preventing direct struct creation, type conversion, and field reassignment when New** constructors exist", Run: run, Requires: []*analysis.Analyzer{inspect.Analyzer}, FactTypes: []analysis.Fact{new(EncapsulatedType)}, }
Analyzer is the gocapsule analyzer that enforces encapsulation.
Functions ¶
Types ¶
type EncapsulatedType ¶ added in v0.2.0
type EncapsulatedType struct {
ConstructorName string
}
EncapsulatedType is a Fact indicating that a type (struct or defined type) has a corresponding New** constructor and should not be directly instantiated or have its fields reassigned from external packages.
func (*EncapsulatedType) AFact ¶ added in v0.2.0
func (*EncapsulatedType) AFact()
AFact implements the analysis.Fact interface.
Click to show internal directories.
Click to hide internal directories.