Documentation ¶
Overview ¶
Package illegal provides runtime support for operations which are disallowed by the compiler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
InterfaceType reflect.Type
)
Convenience reflect.Type values
Functions ¶
func ConvertSlice ¶
func ConvertSlice(slc, example interface{}) interface{}
Convert each element in slc to example's underlying type, and return the conversions in a new slice.
ConvertSlice panics if slc is not a slice value, or if the conversion is illegal.
If ConvertSlice returns without panicking, the return value's underlying value is guaranteed to be a slice, and the element type is guaranteed to be of the same type as example.
func ConvertSliceType ¶
Convert each element in slc to the given type, and return the conversions in a new slice.
ConvertSlice panics if slc is not a slice value, or if the conversion is illegal.
If ConvertSliceType returns without panicking, the return value's underlying value is guaranteed to be a slice, and the element type is guaranteed to be of the same type as typ.
func FuncEqual ¶
func FuncEqual(f1, f2 interface{}) bool
FuncEqual figures out if two function pointers reference the same function. For two closures created from the same original function, it will say that they are equal.
FuncEqual also works on methods. Note that if two interface variables of the same interface type but of two separate concrete types are used to get a function pointer, that pointer will point at the interface methods, not the methods associated with the concrete types, so they will register as equal.
FuncEqual panics if either argument is not a function.
Types ¶
This section is empty.