decoder on string decode, accept floating point numbers and booleans

This commit is contained in:
Lang Martin 2019-06-10 12:13:18 -04:00
parent 99e2f22d1c
commit 1f63d5ffd6

View File

@ -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: