use reflect.TypeFor instead of kludgy reflect.TypeOf

TypeFor was introduced in go1.22, which we already require.
This commit is contained in:
Mechiel Lukkien
2024-11-29 13:17:13 +01:00
parent afb182cb14
commit 96a3ecd52c
2 changed files with 2 additions and 2 deletions

View File

@ -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)