typesutil

package
v0.0.0-...-2571e59 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldToStruct

func FieldToStruct(info *types.Info) map[*types.Var]*types.Struct

FieldToStruct builds a map that links struct field objects back to their declaring struct type. This is used when obfuscating field names and relies on the provided type information.

func IsSafeInstanceType

func IsSafeInstanceType(t types.Type) bool

IsSafeInstanceType reports whether the provided type can be safely used as a variable type when rewriting consts into vars. Generic types and interface types without method sets are excluded.

func IsTestSignature

func IsTestSignature(sign *types.Signature) bool

IsTestSignature reports whether a function signature matches the Go test helper pattern "func _(*testing.T)".

func NamedType

func NamedType(t types.Type) *types.TypeName

NamedType unwraps the provided type until it finds the referenced named type (if any). Type aliases are resolved to their alias object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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