Skip to content

Commit 2d5cfb2

Browse files
committed
fix lint
1 parent 3270fa0 commit 2d5cfb2

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

internal/services/domain/domains_registration.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ func resourceDomainsRegistrationsRead(ctx context.Context, d *schema.ResourceDat
483483
firstResp, err := registrarAPI.GetDomain(&domain.RegistrarAPIGetDomainRequest{
484484
Domain: firstDomain,
485485
}, scw.WithContext(ctx))
486-
487486
if err != nil {
488487
if httperrors.Is404(err) {
489488
d.SetId("")

internal/services/domain/domains_registration_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func testAccCheckDomainStatus(tt *acctest.TestTools, expectedAutoRenew, expected
170170

171171
registrarAPI := domain.NewRegistrarDomainAPI(tt.Meta)
172172
domainNames, err := domain.ExtractDomainsFromTaskID(context.TODO(), rs.Primary.ID, registrarAPI)
173+
173174
if err != nil {
174175
return fmt.Errorf("error extracting domains: %w", err)
175176
}
@@ -178,12 +179,15 @@ func testAccCheckDomainStatus(tt *acctest.TestTools, expectedAutoRenew, expected
178179
domainResp, getErr := registrarAPI.GetDomain(&domainSDK.RegistrarAPIGetDomainRequest{
179180
Domain: domainName,
180181
})
182+
181183
if getErr != nil {
182184
return fmt.Errorf("failed to get details for domain %s: %w", domainName, getErr)
183185
}
186+
184187
if domainResp.AutoRenewStatus.String() != expectedAutoRenew {
185188
return fmt.Errorf("domain %s has auto_renew status %s, expected %s", domainName, domainResp.AutoRenewStatus, expectedAutoRenew)
186189
}
190+
187191
if domainResp.Dnssec.Status.String() != expectedDNSSEC {
188192
return fmt.Errorf("domain %s has dnssec status %s, expected %s", domainName, domainResp.Dnssec.Status.String(), expectedDNSSEC)
189193
}

internal/services/domain/helpers.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func getRecordFromTypeAndData(dnsType domain.RecordType, data string, records []
3636
flattenCurrentData := flattenDomainData(strings.ToLower(data), r.Type).(string)
3737

3838
if strings.HasPrefix(flattedData, flattenCurrentData) && r.Type == dnsType {
39-
4039
if currentRecord != nil {
4140
return nil, errors.New("multiple records found with same type and data")
4241
}
@@ -164,6 +163,7 @@ func expandContactExtension(extensionMap map[string]interface{}, extensionType s
164163
case "nl":
165164
legalFormRegistrationNumber := ""
166165
if value, ok := extensionMap["legal_form_registration_number"]; ok {
166+
167167
if str, isString := value.(string); isString {
168168
legalFormRegistrationNumber = str
169169
}
@@ -176,6 +176,7 @@ func expandContactExtension(extensionMap map[string]interface{}, extensionType s
176176

177177
case "eu":
178178
europeanCitizenship := ""
179+
179180
if value, ok := extensionMap["european_citizenship"]; ok {
180181
if str, isString := value.(string); isString {
181182
europeanCitizenship = str
@@ -303,16 +304,19 @@ func mapToStruct(data map[string]interface{}, target interface{}) {
303304
if v, ok := data["duns_id"].(string); ok {
304305
t.DunsID = v
305306
}
307+
306308
if v, ok := data["local_id"].(string); ok {
307309
t.LocalID = v
308310
}
309311

310312
case *domain.ContactExtensionFRAssociationInfo:
311313
if v, ok := data["publication_jo"].(string); ok {
314+
312315
if parsedTime, err := time.Parse(time.RFC3339, v); err == nil {
313316
t.PublicationJo = &parsedTime
314317
}
315318
}
319+
316320
if v, ok := data["publication_jo_page"].(float64); ok {
317321
t.PublicationJoPage = uint32(v)
318322
}
@@ -331,13 +335,15 @@ func mapToStruct(data map[string]interface{}, target interface{}) {
331335

332336
func getStatusTasks(ctx context.Context, api *domain.RegistrarAPI, taskID string) (domain.TaskStatus, error) {
333337
var page int32 = 1
338+
334339
var pageSize uint32 = 1000
335340

336341
for {
337342
listTasksResponse, err := api.ListTasks(&domain.RegistrarAPIListTasksRequest{
338343
Page: &page,
339344
PageSize: &pageSize,
340345
}, scw.WithContext(ctx))
346+
341347
if err != nil {
342348
return "", fmt.Errorf("error retrieving tasks: %w", err)
343349
}

0 commit comments

Comments
 (0)