From cfb391b6e8f28dcc1f8939ba5721e875c7a76e7e 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 --- vals.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vals.go b/vals.go index c5b4f2df..a942f71c 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)