Documentation
¶
Overview ¶
Package typematcher defines matcher for types (e.g. NoLOck)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClonerMethod ¶
type ClonerMethod struct { // Method name Name string }
func (ClonerMethod) IsFuncImplementor ¶
func (method ClonerMethod) IsFuncImplementor(ty types.Type) bool
func (ClonerMethod) IsImplementor ¶
func (method ClonerMethod) IsImplementor(ty types.Type) bool
type CyclicConversionMethods ¶
CyclicConversionMethods describes method that convert a type A to another type B through Convert, which can be converted back to A through Reverse. If From is false, an input type is assumed to be A, otherwise B.
func (CyclicConversionMethods) ConvertedType ¶
ConvertedType returns the type converted through Convert or Reverse depending on From. The returned value is true only if ty is implementor of mset, in that case returned *types.Named is guaranteed to be non-nil.
func (CyclicConversionMethods) IsImplementor ¶
func (mset CyclicConversionMethods) IsImplementor(ty *types.Named) bool
IsImplementor check if given type ty is implementor of mset. Methods can be implemented on pointer receiver.
type ErrorMethod ¶
type ErrorMethod struct { // Method name. Name string }
ErrorMethod describes a method that takes no argument and returns a single error value. Method name must be as Name.
func (ErrorMethod) IsImplementor ¶
func (method ErrorMethod) IsImplementor(ty *types.Named) bool
IsImplementor checks if ty implements a method named as [ErrorMethod.Name] that take no argument and returns an error.