reflectx

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make[T any]() T

Make creates a fully initialized instance of type T. For pointer types, it recursively initializes each level. For map, slice, and channel types, it returns initialized empty instances. For other types, it returns their zero values.

It panics if: - T is a nil interface (type cannot be determined) - T is a function type (not supported)

func MakeValue

func MakeValue(t reflect.Type) reflect.Value

MakeValue recursively creates a new instance based on the given reflect.Type. The returned Value is always addressable (can be used with Set method). For map, slice, and channel types, it returns initialized empty instances. For pointer types, it recursively creates the element instance and returns a pointer to it. For other types, it returns their zero values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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