Involved Source Filesswapper.go Package reflectlite implements lightweight version of reflect, not using
any package except for "runtime", "unsafe", and "internal/abi"value.goasm.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.
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.
Type : expvar.Var
Type : fmt.Stringer
func TypeOf(i any) 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 Pointer.
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.
Value : database/sql/driver.Validator
func ValueOf(i any) 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.KindKindMethodstring(*ValueError) Error() string
*ValueError : 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.
The pages are generated with Goldsv0.7.0-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.