// method signature, without a receiver, and the Func field is nil.
//
// Methods are sorted in lexicographic order.
+ //
+ // Calling this method will force the linker to retain all exported methods in all packages.
+ // This may make the executable binary larger but will not affect execution time.
Method(int) Method
// MethodByName returns the method with that name in the type's
//
// For an interface type, the returned Method's Type field gives the
// method signature, without a receiver, and the Func field is nil.
+ //
+ // Calling this method will cause the linker to retain all methods with this name in all packages.
+ // If the linker can't determine the name, it will retain all exported methods.
+ // This may make the executable binary larger but will not affect execution time.
MethodByName(string) (Method, bool)
// NumMethod returns the number of methods accessible using Method.
// The arguments to a Call on the returned function should not include
// a receiver; the returned function will always use v as the receiver.
// Method panics if i is out of range or if v is a nil interface value.
+//
+// Calling this method will force the linker to retain all exported methods in all packages.
+// This may make the executable binary larger but will not affect execution time.
func (v Value) Method(i int) Value {
if v.typ() == nil {
panic(&ValueError{"reflect.Value.Method", Invalid})
// The arguments to a Call on the returned function should not include
// a receiver; the returned function will always use v as the receiver.
// It returns the zero Value if no method was found.
+//
+// Calling this method will cause the linker to retain all methods with this name in all packages.
+// If the linker can't determine the name, it will retain all exported methods.
+// This may make the executable binary larger but will not affect execution time.
func (v Value) MethodByName(name string) Value {
if v.typ() == nil {
panic(&ValueError{"reflect.Value.MethodByName", Invalid})