diff options
Diffstat (limited to 'vendor/github.com/hashicorp/hil')
-rw-r--r-- | vendor/github.com/hashicorp/hil/convert.go | 19 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/hil/go.mod | 6 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/hil/go.sum | 4 |
3 files changed, 27 insertions, 2 deletions
diff --git a/vendor/github.com/hashicorp/hil/convert.go b/vendor/github.com/hashicorp/hil/convert.go index f2024d0..184e029 100644 --- a/vendor/github.com/hashicorp/hil/convert.go +++ b/vendor/github.com/hashicorp/hil/convert.go | |||
@@ -47,8 +47,23 @@ func hilMapstructureWeakDecode(m interface{}, rawVal interface{}) error { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | func InterfaceToVariable(input interface{}) (ast.Variable, error) { | 49 | func InterfaceToVariable(input interface{}) (ast.Variable, error) { |
50 | if inputVariable, ok := input.(ast.Variable); ok { | 50 | if iv, ok := input.(ast.Variable); ok { |
51 | return inputVariable, nil | 51 | return iv, nil |
52 | } | ||
53 | |||
54 | // This is just to maintain backward compatibility | ||
55 | // after https://github.com/mitchellh/mapstructure/pull/98 | ||
56 | if v, ok := input.([]ast.Variable); ok { | ||
57 | return ast.Variable{ | ||
58 | Type: ast.TypeList, | ||
59 | Value: v, | ||
60 | }, nil | ||
61 | } | ||
62 | if v, ok := input.(map[string]ast.Variable); ok { | ||
63 | return ast.Variable{ | ||
64 | Type: ast.TypeMap, | ||
65 | Value: v, | ||
66 | }, nil | ||
52 | } | 67 | } |
53 | 68 | ||
54 | var stringVal string | 69 | var stringVal string |
diff --git a/vendor/github.com/hashicorp/hil/go.mod b/vendor/github.com/hashicorp/hil/go.mod new file mode 100644 index 0000000..45719a6 --- /dev/null +++ b/vendor/github.com/hashicorp/hil/go.mod | |||
@@ -0,0 +1,6 @@ | |||
1 | module github.com/hashicorp/hil | ||
2 | |||
3 | require ( | ||
4 | github.com/mitchellh/mapstructure v1.1.2 | ||
5 | github.com/mitchellh/reflectwalk v1.0.0 | ||
6 | ) | ||
diff --git a/vendor/github.com/hashicorp/hil/go.sum b/vendor/github.com/hashicorp/hil/go.sum new file mode 100644 index 0000000..83639b6 --- /dev/null +++ b/vendor/github.com/hashicorp/hil/go.sum | |||
@@ -0,0 +1,4 @@ | |||
1 | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= | ||
2 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= | ||
3 | github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= | ||
4 | github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= | ||