inspect

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

README

go-inspect

Inspect the hidden places of Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncOf

func FuncOf(funcName string) unsafe.Pointer

FuncOf find the function entry by package path and name, the function should be linked and should not be inlined

func GetField

func GetField[T any](obj any, fieldName string) (r T)

func RuntimeFuncOf

func RuntimeFuncOf(funcName string) (r unsafe.Pointer)

RuntimeFuncOf find the function entry by package path and name in runtime, the function should be linked and should not be inlined

func RuntimeTypeOf

func RuntimeTypeOf(typeName string) (r reflect.Type)

RuntimeTypeOf find the type by package path and name in runtime

func SetField

func SetField[T any](obj any, fieldName string, val T)

func TypeOf

func TypeOf(typeName string) reflect.Type

TypeOf find the type by package path and name

Types

type Field

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

func FieldAt

func FieldAt(v reflect.Value, idx int) (Field, bool)

FieldAt locates a field with index.

func FieldByName

func FieldByName(v reflect.Value, name string) (Field, bool)

FieldByName locates a field with name.

func (Field) Get

func (f Field) Get() reflect.Value

Get returns the value of the referenced field, even if it's private.

func (Field) Set

func (f Field) Set(v reflect.Value)

Set updates the value of the referenced field, even if it's private.

Jump to

Keyboard shortcuts

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