reflect

package
v1.42.21 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Ptr = reflect.Ptr
)

Alias a few consts

Variables

View Source
var (
	Append      = reflect.Append
	AppendSlice = reflect.AppendSlice
	// ArrayOf     = reflect.ArrayOf
	ChanOf    = reflect.ChanOf
	CopySlice = reflect.Copy
	DeepEqual = reflect.DeepEqual
	// FuncOf      = reflect.FuncOf
	Indirect  = reflect.Indirect
	MakeChan  = reflect.MakeChan
	MakeFunc  = reflect.MakeFunc
	MakeMap   = reflect.MakeMap
	MakeSlice = reflect.MakeSlice
	MapOf     = reflect.MapOf
	New       = reflect.New
	NewAt     = reflect.NewAt
	PtrTo     = reflect.PtrTo
	Select    = reflect.Select
	SliceOf   = reflect.SliceOf
	// StructOf    = reflect.StructOf
	TypeOf  = reflect.TypeOf
	ValueOf = reflect.ValueOf
	Zero    = reflect.Zero
)

Aliase reflect Funcs

Functions

func Copy

func Copy(src interface{}, dst interface{}) (err error)

func FieldNames

func FieldNames(s interface{}) []string

func IsPtrSlice

func IsPtrSlice(v reflect.Value) bool

Ensure this is a pointer to a slice

func IsSliceOfPtr

func IsSliceOfPtr(slice reflect.Value) bool

Ensure this is a slice of pointers

func IsZero

func IsZero(v reflect.Value) bool

func SetField

func SetField(ps reflect.Value, name string, value interface{}) error

Set field of addressable struct (pointer to struct)

Types

type Type

type Type reflect.Type

Alias a few reflect types

Jump to

Keyboard shortcuts

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