internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportIfStructFieldsNotInOrder

func ReportIfStructFieldsNotInOrder(pass *analysis.Pass, structSpecs *StructSpecs, si StructInst)

Types

type StructInst

type StructInst interface {
	GetCompositeLit() *ast.CompositeLit
	GetKeyValueExpr() []*ast.KeyValueExpr
	// contains filtered or unexported methods
}

func NewStructInst added in v0.1.0

func NewStructInst(pkgPath string, importsSpec []*ast.ImportSpec, cl *ast.CompositeLit) (StructInst, bool)

type StructInstInSamePkgStructDecl added in v0.0.2

type StructInstInSamePkgStructDecl struct {

	// Name of the struct.
	Name string
	// ImportPath of the pkg.
	ImportPath string
	// contains filtered or unexported fields
}

func (StructInstInSamePkgStructDecl) GetCompositeLit added in v0.1.0

func (si StructInstInSamePkgStructDecl) GetCompositeLit() *ast.CompositeLit

func (StructInstInSamePkgStructDecl) GetKeyValueExpr added in v0.1.0

func (si StructInstInSamePkgStructDecl) GetKeyValueExpr() []*ast.KeyValueExpr

func (*StructInstInSamePkgStructDecl) GetStructUniqueIdentifierKey added in v0.0.2

func (si *StructInstInSamePkgStructDecl) GetStructUniqueIdentifierKey() StructUniqueIdentifierKey

GetStructUniqueIdentifierKey returns the unique identifier where the struct was declared.

type StructInstWithAlias added in v0.0.2

type StructInstWithAlias struct {

	// Name of the struct.
	Name string
	// ImportSpec that matches the pkg alias.
	ImportSpec *ast.ImportSpec
	// contains filtered or unexported fields
}

func (StructInstWithAlias) GetCompositeLit added in v0.1.0

func (si StructInstWithAlias) GetCompositeLit() *ast.CompositeLit

func (StructInstWithAlias) GetKeyValueExpr added in v0.1.0

func (si StructInstWithAlias) GetKeyValueExpr() []*ast.KeyValueExpr

func (*StructInstWithAlias) GetStructUniqueIdentifierKey added in v0.0.2

func (si *StructInstWithAlias) GetStructUniqueIdentifierKey() StructUniqueIdentifierKey

GetStructUniqueIdentifierKey returns the unique identifier where the struct was declared.

type StructInstWithDotImports added in v0.0.2

type StructInstWithDotImports struct {

	// Name of the struct.
	Name string
	// ImportPath of the pkg.
	ImportPath string
	// Dot Import Specs, contains all the dot imports of the file where the struct was instantiated.
	DotImports []*ast.ImportSpec
	// contains filtered or unexported fields
}

func (StructInstWithDotImports) GetCompositeLit added in v0.1.0

func (si StructInstWithDotImports) GetCompositeLit() *ast.CompositeLit

func (StructInstWithDotImports) GetKeyValueExpr added in v0.1.0

func (si StructInstWithDotImports) GetKeyValueExpr() []*ast.KeyValueExpr

func (*StructInstWithDotImports) GetMatchingStructSpecs added in v0.0.2

func (si *StructInstWithDotImports) GetMatchingStructSpecs(
	structSpecsIndexed map[StructUniqueIdentifierKey]*StructSpecs,
) (*StructSpecs, bool)

type StructSpecs added in v0.0.2

type StructSpecs struct {
	*ast.TypeSpec

	UniqueKey StructUniqueIdentifierKey
	// contains filtered or unexported fields
}

func NewStructSpecs added in v0.0.2

func NewStructSpecs(pass *analysis.Pass, ts *ast.TypeSpec) (*StructSpecs, bool)

func (*StructSpecs) FullImportPath added in v0.0.2

func (ss *StructSpecs) FullImportPath() string

FullImportPath returns the full import path for this struct declaration.

func (*StructSpecs) GetFieldNames added in v0.0.2

func (ss *StructSpecs) GetFieldNames() []string

type StructUniqueIdentifierKey added in v0.0.2

type StructUniqueIdentifierKey struct {
	// Pkg the package the node is declared
	Pkg string
	// Name the package the node is declared
	Name string
}

StructUniqueIdentifierKey represents how to uniquely identify a Struct.

func (StructUniqueIdentifierKey) FullImportPath added in v0.0.2

func (uk StructUniqueIdentifierKey) FullImportPath(modName string) string

Jump to

Keyboard shortcuts

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