Refactoring the resourceInstanceTags func just a little
My eye caught this somewhat un-logic mixed use of ‘vs’ and ‘v.(*schema.Set)’, so thought to make it a little cleaner…
This commit is contained in:
parent
144ceb8003
commit
bed36cc86a
|
@ -514,10 +514,10 @@ func resourceInstanceTags(d *schema.ResourceData) *compute.Tags {
|
||||||
// Calculate the tags
|
// Calculate the tags
|
||||||
var tags *compute.Tags
|
var tags *compute.Tags
|
||||||
if v := d.Get("tags"); v != nil {
|
if v := d.Get("tags"); v != nil {
|
||||||
vs := v.(*schema.Set).List()
|
vs := v.(*schema.Set)
|
||||||
tags = new(compute.Tags)
|
tags = new(compute.Tags)
|
||||||
tags.Items = make([]string, len(vs))
|
tags.Items = make([]string, vs.Len())
|
||||||
for i, v := range v.(*schema.Set).List() {
|
for i, v := range vs.List() {
|
||||||
tags.Items[i] = v.(string)
|
tags.Items[i] = v.(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue