Compare commits

...

2 Commits

Author SHA1 Message Date
f826633e6e v0.0.206 2023-07-24 18:50:14 +02:00
edeae23bf1 v0.0.205 2023-07-24 18:47:48 +02:00
2 changed files with 13 additions and 4 deletions

View File

@@ -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"
)
@@ -132,8 +134,15 @@ func nameOfFunction(f any) string {
fname = split[len(split)-1]
if strings.HasSuffix(fname, ".func1") {
fname = fname[len(fname)-len(".func1"):]
// https://stackoverflow.com/a/32925345/1761622
if strings.HasSuffix(fname, "-fm") {
fname = fname[:len(fname)-len("-fm")]
}
suffix := rext.W(regexp.MustCompile("\\.func[0-9]+$"))
if match, ok := suffix.MatchFirst(fname); ok {
fname = fname[:len(fname)-match.FullMatch().Length()]
}
return fname

View File

@@ -1,5 +1,5 @@
package goext
const GoextVersion = "0.0.204"
const GoextVersion = "0.0.206"
const GoextVersionTimestamp = "2023-07-24T18:42:33+0200"
const GoextVersionTimestamp = "2023-07-24T18:50:14+0200"