parent
c4857bdbaf
commit
b01f68f343
|
@ -782,18 +782,18 @@ func decodeConfig(d *schema.ResourceData) (*provisioner, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getStringList(v interface{}) []string {
|
func getStringList(v interface{}) []string {
|
||||||
if v == nil {
|
var result []string
|
||||||
return nil
|
|
||||||
}
|
switch v := v.(type) {
|
||||||
switch l := v.(type) {
|
case nil:
|
||||||
case []string:
|
return result
|
||||||
return l
|
|
||||||
case []interface{}:
|
case []interface{}:
|
||||||
arr := make([]string, len(l))
|
for _, vv := range v {
|
||||||
for i, x := range l {
|
if vv, ok := vv.(string); ok {
|
||||||
arr[i] = x.(string)
|
result = append(result, vv)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return arr
|
return result
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Unsupported type: %T", v))
|
panic(fmt.Sprintf("Unsupported type: %T", v))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue