3 // Copyright 2020 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Similar to reflectmethod5.go, but for reflect.Type.MethodByName.
17 func (foo) X() { called = true }
19 var h = reflect.Type.MethodByName
22 v := reflect.ValueOf(foo{})
23 m, ok := h(v.Type(), "X")
27 f := m.Func.Interface().(func(foo))