This commit is contained in:
2023-07-24 18:42:33 +02:00
parent ede0b99d3a
commit a038b86147
3 changed files with 15 additions and 9 deletions

View File

@@ -123,12 +123,18 @@ func (w *GinWrapper) NoRoute(handler WHandlerFunc) {
func nameOfFunction(f any) string {
n := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
fname := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
split := strings.Split(n, "/")
split := strings.Split(fname, "/")
if len(split) == 0 {
return ""
}
return split[len(split)-1]
fname = split[len(split)-1]
if strings.HasSuffix(fname, ".func1") {
fname = fname[len(fname)-len(".func1"):]
}
return fname
}