package reflectlite

Import Path
	internal/reflectlite (on golang.org and go.dev)

Dependency Relation
	imports 3 packages, and imported by 3 packages

Involved Source Files swapper.go Package reflectlite implements lightweight version of reflect, not using any package except for "runtime" and "unsafe". value.go asm.s
Package-Level Type Names (total 4)
/* sort by: | */
A Kind represents the specific kind of type that a Type represents. The zero Kind is not a valid kind. String returns the name of k. T : expvar.Var T : fmt.Stringer func Type.Kind() Kind func Value.Kind() Kind const Array const Bool const Chan const Complex128 const Complex64 const Float32 const Float64 const Func const Int const Int16 const Int32 const Int64 const Int8 const Interface const Invalid const Map const Ptr const Slice const String const Struct const Uint const Uint16 const Uint32 const Uint64 const Uint8 const Uintptr const UnsafePointer
Type is the representation of a Go type. Not all methods apply to all kinds of types. Restrictions, if any, are noted in the documentation for each method. Use the Kind method to find out the kind of type before calling kind-specific methods. Calling a method inappropriate to the kind of type causes a run-time panic. Type values are comparable, such as with the == operator, so they can be used as map keys. Two Type values are equal if they represent identical types. AssignableTo reports whether a value of the type is assignable to type u. Comparable reports whether values of this type are comparable. Elem returns a type's element type. It panics if the type's Kind is not Ptr. Implements reports whether the type implements the interface type u. Kind returns the specific kind of this type. Name returns the type's name within its package for a defined type. For other (non-defined) types it returns the empty string. PkgPath returns a defined type's package path, that is, the import path that uniquely identifies the package, such as "encoding/base64". If the type was predeclared (string, error) or not defined (*T, struct{}, []int, or A where A is an alias for a non-defined type), the package path will be the empty string. Size returns the number of bytes needed to store a value of the given type; it is analogous to unsafe.Sizeof. String returns a string representation of the type. The string representation may use shortened package names (e.g., base64 instead of "encoding/base64") and is not guaranteed to be unique among types. To test for type identity, compare the Types directly. T : expvar.Var T : fmt.Stringer func TypeOf(i interface{}) Type func Type.Elem() Type func Value.Type() Type func Type.AssignableTo(u Type) bool func Type.Implements(u Type) bool
Value is the reflection interface to a Go value. Not all methods apply to all kinds of values. Restrictions, if any, are noted in the documentation for each method. Use the Kind method to find out the kind of value before calling kind-specific methods. Calling a method inappropriate to the kind of type causes a run time panic. The zero Value represents no value. Its IsValid method returns false, its Kind method returns Invalid, its String method returns "<invalid Value>", and all other methods panic. Most functions and methods never return an invalid value. If one does, its documentation states the conditions explicitly. A Value can be used concurrently by multiple goroutines provided that the underlying Go value can be used concurrently for the equivalent direct operations. To compare two Values, compare the results of the Interface method. Using == on two Values does not compare the underlying values they represent. CanSet reports whether the value of v can be changed. A Value can be changed only if it is addressable and was not obtained by the use of unexported struct fields. If CanSet returns false, calling Set or any type-specific setter (e.g., SetBool, SetInt) will panic. Elem returns the value that the interface v contains or that the pointer v points to. It panics if v's Kind is not Interface or Ptr. It returns the zero Value if v is nil. IsNil reports whether its argument v is nil. The argument must be a chan, func, interface, map, pointer, or slice value; if it is not, IsNil panics. Note that IsNil is not always equivalent to a regular comparison with nil in Go. For example, if v was created by calling ValueOf with an uninitialized interface variable i, i==nil will be true but v.IsNil will panic as v will be the zero Value. IsValid reports whether v represents a value. It returns false if v is the zero Value. If IsValid returns false, all other methods except String panic. Most functions and methods never return an invalid Value. If one does, its documentation states the conditions explicitly. Kind returns v's Kind. If v is the zero Value (IsValid returns false), Kind returns Invalid. Len returns v's length. It panics if v's Kind is not Array, Chan, Map, Slice, or String. Set assigns x to the value v. It panics if CanSet returns false. As in Go, x's value must be assignable to v's type. Type returns v's type. T : database/sql/driver.Validator func ValueOf(i interface{}) Value func Value.Elem() Value func Value.Set(x Value)
A ValueError occurs when a Value method is invoked on a Value that does not support it. Such cases are documented in the description of each method. Kind Kind Method string (*T) Error() string *T : error
Package-Level Functions (total 3)
Swapper returns a function that swaps the elements in the provided slice. Swapper panics if the provided interface is not a slice.
TypeOf returns the reflection Type that represents the dynamic type of i. If i is a nil interface value, TypeOf returns nil.
ValueOf returns a new Value initialized to the concrete value stored in the interface i. ValueOf(nil) returns the zero Value.
Package-Level Constants (total 27)
const Array Kind = 17
const Bool Kind = 1
const Chan Kind = 18
const Complex128 Kind = 16
const Complex64 Kind = 15
const Float32 Kind = 13
const Float64 Kind = 14
const Func Kind = 19
const Int Kind = 2
const Int16 Kind = 4
const Int32 Kind = 5
const Int64 Kind = 6
const Int8 Kind = 3
const Interface Kind = 20
const Invalid Kind = 0
const Map Kind = 21
const Ptr Kind = 22
const Slice Kind = 23
const String Kind = 24
const Struct Kind = 25
const Uint Kind = 7
const Uint16 Kind = 9
const Uint32 Kind = 10
const Uint64 Kind = 11
const Uint8 Kind = 8
const Uintptr Kind = 12
const UnsafePointer Kind = 26