diff --git a/main.go b/main.go index ec2b662..38b4d14 100644 --- a/main.go +++ b/main.go @@ -2856,7 +2856,7 @@ func cmdWebapi(c *cmd) { c.Usage() } - t := reflect.TypeOf((*webapi.Methods)(nil)).Elem() + t := reflect.TypeFor[webapi.Methods]() methods := map[string]reflect.Type{} var ml []string for i := 0; i < t.NumMethod(); i++ { diff --git a/webapisrv/server.go b/webapisrv/server.go index 448c433..84305da 100644 --- a/webapisrv/server.go +++ b/webapisrv/server.go @@ -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)