Skip to content

Commit 3e6601a

Browse files
committed
fix lint
1 parent fdad7e3 commit 3e6601a

File tree

3 files changed

+67
-333
lines changed

3 files changed

+67
-333
lines changed

internal/services/domain/domain_data_source.go

Lines changed: 0 additions & 260 deletions
This file was deleted.

internal/services/domain/domains_registration.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,13 @@ func resourceDomainsRegistrationsRead(ctx context.Context, d *schema.ResourceDat
496496
computedTechnicalContact := flattenContact(firstResp.TechnicalContact)
497497

498498
computedAutoRenew := false
499-
if firstResp.AutoRenewStatus.String() == "enabled" {
499+
if firstResp.AutoRenewStatus == domain.DomainFeatureStatusEnabled {
500500
computedAutoRenew = true
501501
}
502502

503503
computedDnssec := false
504504

505-
if firstResp.Dnssec.Status == "enabled" {
505+
if firstResp.Dnssec.Status == domain.DomainFeatureStatusEnabled {
506506
computedDnssec = true
507507
}
508508

@@ -552,7 +552,7 @@ func resourceDomainsRegistrationUpdate(ctx context.Context, d *schema.ResourceDa
552552
Domain: domainName,
553553
}, scw.WithContext(ctx))
554554
if err != nil {
555-
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %v", domainName, err))
555+
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %w", domainName, err))
556556
}
557557

558558
if newAutoRenew {
@@ -561,7 +561,7 @@ func resourceDomainsRegistrationUpdate(ctx context.Context, d *schema.ResourceDa
561561
Domain: domainName,
562562
}, scw.WithContext(ctx))
563563
if err != nil {
564-
return diag.FromErr(fmt.Errorf("failed to enable auto-renew for %s: %v", domainName, err))
564+
return diag.FromErr(fmt.Errorf("failed to enable auto-renew for %s: %w", domainName, err))
565565
}
566566
}
567567
} else {
@@ -570,7 +570,7 @@ func resourceDomainsRegistrationUpdate(ctx context.Context, d *schema.ResourceDa
570570
Domain: domainName,
571571
}, scw.WithContext(ctx))
572572
if err != nil {
573-
return diag.FromErr(fmt.Errorf("failed to disable auto-renew for %s: %v", domainName, err))
573+
return diag.FromErr(fmt.Errorf("failed to disable auto-renew for %s: %w", domainName, err))
574574
}
575575
}
576576
}
@@ -588,7 +588,7 @@ func resourceDomainsRegistrationUpdate(ctx context.Context, d *schema.ResourceDa
588588
Domain: domainName,
589589
}, scw.WithContext(ctx))
590590
if err != nil {
591-
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %v", domainName, err))
591+
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %w", domainName, err))
592592
}
593593

594594
if newDnssec {
@@ -604,16 +604,14 @@ func resourceDomainsRegistrationUpdate(ctx context.Context, d *schema.ResourceDa
604604
DsRecord: dsRecord,
605605
}, scw.WithContext(ctx))
606606
if err != nil {
607-
return diag.FromErr(fmt.Errorf("failed to enable dnssec for %s: %v", domainName, err))
607+
return diag.FromErr(fmt.Errorf("failed to enable dnssec for %s: %w", domainName, err))
608608
}
609-
} else {
610-
if domainResp.Dnssec != nil && domainResp.Dnssec.Status == "enabled" {
611-
_, err = registrarAPI.DisableDomainDNSSEC(&domain.RegistrarAPIDisableDomainDNSSECRequest{
612-
Domain: domainName,
613-
}, scw.WithContext(ctx))
614-
if err != nil {
615-
return diag.FromErr(fmt.Errorf("failed to disable dnssec for %s: %v", domainName, err))
616-
}
609+
} else if domainResp.Dnssec != nil && domainResp.Dnssec.Status == domain.DomainFeatureStatusEnabled {
610+
_, err = registrarAPI.DisableDomainDNSSEC(&domain.RegistrarAPIDisableDomainDNSSECRequest{
611+
Domain: domainName,
612+
}, scw.WithContext(ctx))
613+
if err != nil {
614+
return diag.FromErr(fmt.Errorf("failed to disable dnssec for %s: %w", domainName, err))
617615
}
618616
}
619617
_, err = waitForDNSSECStatus(ctx, registrarAPI, domainName, d.Timeout(schema.TimeoutUpdate))
@@ -643,7 +641,7 @@ func resourceDomainsRegistrationDelete(ctx context.Context, d *schema.ResourceDa
643641
if httperrors.Is404(err) {
644642
continue
645643
}
646-
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %v", domainName, err))
644+
return diag.FromErr(fmt.Errorf("failed to get domain details for %s: %w", domainName, err))
647645
}
648646

649647
if domainResp.AutoRenewStatus == domain.DomainFeatureStatusEnabled ||
@@ -652,7 +650,7 @@ func resourceDomainsRegistrationDelete(ctx context.Context, d *schema.ResourceDa
652650
Domain: domainName,
653651
}, scw.WithContext(ctx))
654652
if err != nil {
655-
return diag.FromErr(fmt.Errorf("failed to disable auto-renew for %s: %v", domainName, err))
653+
return diag.FromErr(fmt.Errorf("failed to disable auto-renew for %s: %w", domainName, err))
656654
}
657655
}
658656
}

0 commit comments

Comments
 (0)