Documentation ¶
Overview ¶
Package types mimics the https://golang.org/pkg/go/types/ package. It also contains some extra utility functions, they're defined in ext.go file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Identical ¶
Identical reports whether x and y are identical types. Receivers of Signature types are ignored.
func Implements ¶
Implements reports whether a given type implements the specified interface.
Types ¶
type Array ¶ added in v0.3.1
type Array struct{}
An Array represents an array type.
func AsArray ¶ added in v0.3.1
AsArray is a type-assert like operation, x.(*Array), but never panics. Returns nil if type is not an array.
func NewArray ¶ added in v0.3.1
NewArray returns a new array type for the given element type and length. A negative length indicates an unknown length.
func (*Array) Len ¶ added in v0.3.1
Len returns the length of array. A negative result indicates an unknown length.
func (*Array) Underlying ¶ added in v0.3.1
type Interface ¶
type Interface struct{}
An Interface represents an interface type.
func AsInterface ¶
AsInterface is a type-assert like operation, x.(*Interface), but never panics. Returns nil if type is not an interface.
func (*Interface) Underlying ¶
type Pointer ¶
type Pointer struct{}
A Pointer represents a pointer type.
func AsPointer ¶
AsPointer is a type-assert like operation, x.(*Pointer), but never panics. Returns nil if type is not a pointer.
func NewPointer ¶
NewPointer returns a new pointer type for the given element (base) type.
func (*Pointer) Underlying ¶
type Slice ¶ added in v0.3.1
type Slice struct{}
A Slice represents a slice type.
func AsSlice ¶ added in v0.3.1
AsSlice is a type-assert like operation, x.(*Slice), but never panics. Returns nil if type is not an array.
func (*Slice) Underlying ¶ added in v0.3.1
type Struct ¶ added in v0.3.20
type Struct struct{}
A struct represents a struct type.
func AsStruct ¶ added in v0.3.20
AsStruct is a type-assert like operation, x.(*Struct), but never panics. Returns nil if type is not a struct.