diff --git a/builtin/providers/heroku/resource_heroku_app.go b/builtin/providers/heroku/resource_heroku_app.go index 3fe5a3ea4..41a42d494 100644 --- a/builtin/providers/heroku/resource_heroku_app.go +++ b/builtin/providers/heroku/resource_heroku_app.go @@ -118,17 +118,17 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error { // Build up our creation options opts := heroku.AppCreateOpts{} - if v := d.Get("name"); v != nil { + if v, ok := d.GetOk("name"); ok { vs := v.(string) log.Printf("[DEBUG] App name: %s", vs) opts.Name = &vs } - if v := d.Get("region"); v != nil { + if v, ok := d.GetOk("region"); ok { vs := v.(string) log.Printf("[DEBUG] App region: %s", vs) opts.Region = &vs } - if v := d.Get("stack"); v != nil { + if v, ok := d.GetOk("stack"); ok { vs := v.(string) log.Printf("[DEBUG] App stack: %s", vs) opts.Stack = &vs @@ -143,7 +143,7 @@ func resourceHerokuAppCreate(d *schema.ResourceData, meta interface{}) error { d.SetId(a.Name) log.Printf("[INFO] App ID: %s", d.Id()) - if v := d.Get("config_vars"); v != nil { + if v, ok := d.GetOk("config_vars"); ok { err = update_config_vars(d.Id(), client, nil, v.([]interface{})) if err != nil { return err @@ -157,22 +157,22 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error client := meta.(*heroku.Service) // Build up our creation options opts := heroku.OrganizationAppCreateOpts{} - if v := d.Get("organization"); v != nil { + if v, ok := d.GetOk("organization"); ok { vs := v.(string) log.Printf("[DEBUG] App name: %s", vs) opts.Organization = &vs } - if v := d.Get("name"); v != nil { + if v, ok := d.GetOk("name"); ok { vs := v.(string) log.Printf("[DEBUG] App name: %s", vs) opts.Name = &vs } - if v := d.Get("region"); v != nil { + if v, ok := d.GetOk("region"); ok { vs := v.(string) log.Printf("[DEBUG] App region: %s", vs) opts.Region = &vs } - if v := d.Get("stack"); v != nil { + if v, ok := d.GetOk("stack"); ok { vs := v.(string) log.Printf("[DEBUG] App stack: %s", vs) opts.Stack = &vs @@ -187,7 +187,7 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error d.SetId(a.Name) log.Printf("[INFO] App ID: %s", d.Id()) - if v := d.Get("config_vars"); v != nil { + if v, ok := d.GetOk("config_vars"); ok { err = update_config_vars(d.Id(), client, nil, v.([]interface{})) if err != nil { return err