@@ -171,23 +171,25 @@ func resourceMailginDomainRetrieve(id string, client *mailgun.Client, d *schema.
171171 d .Set ("wildcard" , resp .Domain .Wildcard )
172172 d .Set ("spam_action" , resp .Domain .SpamAction )
173173
174- d . Set ( "receiving_records" , make ([]interface {}, len (resp .ReceivingRecords ) ))
174+ receivingRecords := make ([]map [ string ] interface {}, len (resp .ReceivingRecords ))
175175 for i , r := range resp .ReceivingRecords {
176- prefix := fmt . Sprintf ( "receiving_records.%d" , i )
177- d . Set ( prefix + ". priority", r .Priority )
178- d . Set ( prefix + ". valid", r .Valid )
179- d . Set ( prefix + ". value", r .Value )
180- d . Set ( prefix + ". record_type", r .RecordType )
176+ receivingRecords [ i ] = make ( map [ string ] interface {} )
177+ receivingRecords [ i ][ " priority"] = r .Priority
178+ receivingRecords [ i ][ " valid"] = r .Valid
179+ receivingRecords [ i ][ " value"] = r .Value
180+ receivingRecords [ i ][ " record_type"] = r .RecordType
181181 }
182+ d .Set ("receiving_records" , receivingRecords )
182183
183- d . Set ( "sending_records" , make ([]interface {}, len (resp .SendingRecords ) ))
184+ sendingRecords := make ([]map [ string ] interface {}, len (resp .SendingRecords ))
184185 for i , r := range resp .SendingRecords {
185- prefix := fmt . Sprintf ( "sending_records.%d" , i )
186- d . Set ( prefix + ". name", r .Name )
187- d . Set ( prefix + ". valid", r .Valid )
188- d . Set ( prefix + ". value", r .Value )
189- d . Set ( prefix + ". record_type", r .RecordType )
186+ sendingRecords [ i ] = make ( map [ string ] interface {} )
187+ sendingRecords [ i ][ " name"] = r .Name
188+ sendingRecords [ i ][ " valid"] = r .Valid
189+ sendingRecords [ i ][ " value"] = r .Value
190+ sendingRecords [ i ][ " record_type"] = r .RecordType
190191 }
192+ d .Set ("sending_records" , sendingRecords )
191193
192194 return & resp , nil
193195}
0 commit comments