diff options
author | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
---|---|---|
committer | Radek Simko <radek.simko@gmail.com> | 2017-08-10 14:38:14 +0200 |
commit | c680a8e1622ed0f18751d9d167c836ee24f5e897 (patch) | |
tree | 864f925049d422033dd25a73bafce32b361c8827 /vendor/github.com/hashicorp/terraform/flatmap | |
parent | 38f8880ac81bfabc6d7f82e4dc89661f20fc559e (diff) | |
download | terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.gz terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.tar.zst terraform-provider-statuscake-c680a8e1622ed0f18751d9d167c836ee24f5e897.zip |
vendor: github.com/hashicorp/terraform/...@v0.10.0
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/flatmap')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/flatmap/expand.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/hashicorp/terraform/flatmap/expand.go b/vendor/github.com/hashicorp/terraform/flatmap/expand.go index e0b81b6..1449065 100644 --- a/vendor/github.com/hashicorp/terraform/flatmap/expand.go +++ b/vendor/github.com/hashicorp/terraform/flatmap/expand.go | |||
@@ -60,6 +60,11 @@ func expandArray(m map[string]string, prefix string) []interface{} { | |||
60 | return []interface{}{} | 60 | return []interface{}{} |
61 | } | 61 | } |
62 | 62 | ||
63 | // NOTE: "num" is not necessarily accurate, e.g. if a user tampers | ||
64 | // with state, so the following code should not crash when given a | ||
65 | // number of items more or less than what's given in num. The | ||
66 | // num key is mainly just a hint that this is a list or set. | ||
67 | |||
63 | // The Schema "Set" type stores its values in an array format, but | 68 | // The Schema "Set" type stores its values in an array format, but |
64 | // using numeric hash values instead of ordinal keys. Take the set | 69 | // using numeric hash values instead of ordinal keys. Take the set |
65 | // of keys regardless of value, and expand them in numeric order. | 70 | // of keys regardless of value, and expand them in numeric order. |
@@ -101,7 +106,7 @@ func expandArray(m map[string]string, prefix string) []interface{} { | |||
101 | } | 106 | } |
102 | sort.Ints(keysList) | 107 | sort.Ints(keysList) |
103 | 108 | ||
104 | result := make([]interface{}, num) | 109 | result := make([]interface{}, len(keysList)) |
105 | for i, key := range keysList { | 110 | for i, key := range keysList { |
106 | keyString := strconv.Itoa(key) | 111 | keyString := strconv.Itoa(key) |
107 | if computed[keyString] { | 112 | if computed[keyString] { |