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 721edb1b9a
commit ede6d4bc80

View File

@ -514,10 +514,10 @@ func resourceInstanceTags(d *schema.ResourceData) *compute.Tags {
// Calculate the tags
var tags *compute.Tags
if v := d.Get("tags"); v != nil {
vs := v.(*schema.Set).List()
vs := v.(*schema.Set)
tags = new(compute.Tags)
tags.Items = make([]string, len(vs))
for i, v := range v.(*schema.Set).List() {
tags.Items = make([]string, vs.Len())
for i, v := range vs.List() {
tags.Items[i] = v.(string)
}