mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
use reflect.TypeFor instead of kludgy reflect.TypeOf
TypeFor was introduced in go1.22, which we already require.
This commit is contained in:
@ -199,7 +199,7 @@ var docsIndex []byte
|
||||
|
||||
func init() {
|
||||
var methods []string
|
||||
mt := reflect.TypeOf((*webapi.Methods)(nil)).Elem()
|
||||
mt := reflect.TypeFor[webapi.Methods]()
|
||||
n := mt.NumMethod()
|
||||
for i := 0; i < n; i++ {
|
||||
methods = append(methods, mt.Method(i).Name)
|
||||
|
Reference in New Issue
Block a user