simplify HasSuffix check

This commit is contained in:
Clint Shryock 2015-02-11 16:49:03 -08:00
parent 90c8317899
commit 1ee3d232a1
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ func resourceAwsRoute53RecordCreate(d *schema.ResourceData, meta interface{}) er
// and keep AWS happy.
recordName := d.Get("name").(string)
zoneName := strings.Trim(zoneRecord.HostedZone.Name, ".")
if ok := strings.HasSuffix(recordName, zoneName); !ok {
if !strings.HasSuffix(recordName, zoneName) {
d.Set("name", strings.Join([]string{recordName, zoneName}, "."))
}