internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HasFieldOrder

type HasFieldOrder struct {
	// contains filtered or unexported fields
}

HasFieldOrder is a Fact attached to structs listing the field instantiation order.

func NewHasFieldOrder

func NewHasFieldOrder(ol []string) *HasFieldOrder

func (HasFieldOrder) AFact

func (h HasFieldOrder) AFact()

func (HasFieldOrder) FieldOrder

func (h HasFieldOrder) FieldOrder() []string

FieldOrder returns a defensive copy of the expected field order.

func (HasFieldOrder) String

func (h HasFieldOrder) String() string

type StructDecl

type StructDecl struct {
	// contains filtered or unexported fields
}

StructDecl represents a struct declaration.

func NewStructDecl

func NewStructDecl(ts *ast.TypeSpec, doc *ast.CommentGroup) (StructDecl, bool)

NewStructDecl creates a new StructDecl. It needs to have a directive: //go:structinit.

func (*StructDecl) FieldOrder

func (s *StructDecl) FieldOrder() []string

type StructInit

type StructInit struct {
	// contains filtered or unexported fields
}

func NewStructInit

func NewStructInit(cl *ast.CompositeLit) (StructInit, bool)

func (StructInit) Diagnose

func (s StructInit) Diagnose(fset *token.FileSet, expectedOrder []string) *analysis.Diagnostic

Diagnose checks if the fields are initialized in the correct order. TODO: think about using pass.

Jump to

Keyboard shortcuts

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