From 2a17ba2f72c040f87035f71c69f16b87407b2229 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 18 May 2021 16:24:31 +0200 Subject: [PATCH] fix: allow non-Stringer using %v format (unsafe but does the job) --- handler.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/handler.go b/handler.go index f4b104b..a4a3af1 100644 --- a/handler.go +++ b/handler.go @@ -59,13 +59,11 @@ func (s Handler) resolve(w http.ResponseWriter, r *http.Request) { for b, perm := range list { scope[a][b] = perm for name, value := range input.Data { - if stringer, ok := value.(fmt.Stringer); ok { - scope[a][b] = strings.ReplaceAll( - scope[a][b], - fmt.Sprintf("[%s]", name), - fmt.Sprintf("[%s]", stringer), - ) - } + scope[a][b] = strings.ReplaceAll( + scope[a][b], + fmt.Sprintf("[%s]", name), + fmt.Sprintf("[%v]", value), + ) } } }