From bb02e528ee50302787a62709f2b557717691e028 Mon Sep 17 00:00:00 2001 From: Bernardo Salazar Date: Sun, 31 Dec 2023 13:46:21 +0100 Subject: [PATCH] fix: render int and bool types Handles int and bool types when returned as string map value. Resolves: #114 and #190 Signed-off-by: Bernardo Salazar --- vals.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vals.go b/vals.go index c5b4f2d..a942f71 100644 --- a/vals.go +++ b/vals.go @@ -373,6 +373,10 @@ func (r *Runtime) prepare() (*expansion.ExpandRegexMatch, error) { for i, k := range keys { newobj := map[string]interface{}{} switch t := obj[k].(type) { + case int: + return fmt.Sprint(t), nil + case bool: + return fmt.Sprint(t), nil case string: if i != len(keys)-1 { return "", fmt.Errorf("unexpected type of value for key at %d=%s in %v: expected map[string]interface{}, got %v(%T)", i, k, keys, t, t)