diff options
Diffstat (limited to 'vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go')
-rw-r--r-- | vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go index e563ee3..e0dbf49 100644 --- a/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go +++ b/vendor/github.com/zclconf/go-cty/cty/convert/conversion_primitive.go | |||
@@ -1,8 +1,6 @@ | |||
1 | package convert | 1 | package convert |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "math/big" | ||
5 | |||
6 | "github.com/zclconf/go-cty/cty" | 4 | "github.com/zclconf/go-cty/cty" |
7 | ) | 5 | ) |
8 | 6 | ||
@@ -30,11 +28,11 @@ var primitiveConversionsSafe = map[cty.Type]map[cty.Type]conversion{ | |||
30 | var primitiveConversionsUnsafe = map[cty.Type]map[cty.Type]conversion{ | 28 | var primitiveConversionsUnsafe = map[cty.Type]map[cty.Type]conversion{ |
31 | cty.String: { | 29 | cty.String: { |
32 | cty.Number: func(val cty.Value, path cty.Path) (cty.Value, error) { | 30 | cty.Number: func(val cty.Value, path cty.Path) (cty.Value, error) { |
33 | f, _, err := big.ParseFloat(val.AsString(), 10, 512, big.ToNearestEven) | 31 | v, err := cty.ParseNumberVal(val.AsString()) |
34 | if err != nil { | 32 | if err != nil { |
35 | return cty.NilVal, path.NewErrorf("a number is required") | 33 | return cty.NilVal, path.NewErrorf("a number is required") |
36 | } | 34 | } |
37 | return cty.NumberVal(f), nil | 35 | return v, nil |
38 | }, | 36 | }, |
39 | cty.Bool: func(val cty.Value, path cty.Path) (cty.Value, error) { | 37 | cty.Bool: func(val cty.Value, path cty.Path) (cty.Value, error) { |
40 | switch val.AsString() { | 38 | switch val.AsString() { |