From 1f63d5ffd63196856f3a737dbe459337a35280a7 Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Mon, 10 Jun 2019 12:13:18 -0400 Subject: [PATCH] decoder on string decode, accept floating point numbers and booleans --- decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decoder.go b/decoder.go index 5e32563..6ed2fb9 100644 --- a/decoder.go +++ b/decoder.go @@ -535,7 +535,7 @@ func (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) switch n := node.(type) { case *ast.LiteralType: switch n.Token.Type { - case token.NUMBER: + case token.NUMBER, token.FLOAT, token.BOOL: result.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type())) return nil case token.STRING, token.HEREDOC: