From f826633e6edafc96ba26b99e8d8ce29129b4ad51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 24 Jul 2023 18:50:14 +0200 Subject: [PATCH] v0.0.206 --- ginext/routes.go | 8 ++++++-- goextVersion.go | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ginext/routes.go b/ginext/routes.go index 444ddff..6a02e7a 100644 --- a/ginext/routes.go +++ b/ginext/routes.go @@ -3,8 +3,10 @@ package ginext import ( "github.com/gin-gonic/gin" "gogs.mikescher.com/BlackForestBytes/goext/langext" + "gogs.mikescher.com/BlackForestBytes/goext/rext" "net/http" "reflect" + "regexp" "runtime" "strings" ) @@ -137,8 +139,10 @@ func nameOfFunction(f any) string { fname = fname[:len(fname)-len("-fm")] } - if strings.HasSuffix(fname, ".func1") { - fname = fname[:len(fname)-len(".func1")] + suffix := rext.W(regexp.MustCompile("\\.func[0-9]+$")) + + if match, ok := suffix.MatchFirst(fname); ok { + fname = fname[:len(fname)-match.FullMatch().Length()] } return fname diff --git a/goextVersion.go b/goextVersion.go index 346b2af..09081f8 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.205" +const GoextVersion = "0.0.206" -const GoextVersionTimestamp = "2023-07-24T18:47:48+0200" +const GoextVersionTimestamp = "2023-07-24T18:50:14+0200"