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:
Sander van Harmelen 2014-11-20 11:32:15 +01:00
parent 144ceb8003
commit bed36cc86a
1 changed files with 3 additions and 3 deletions

View File

@ -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)
} }