Skip to content

Commit

Permalink
Fixed lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
bsimonWallix committed Nov 15, 2024
1 parent 02d642f commit 9011ef9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bastion/resource_domain_account_credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bastion
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
Expand Down Expand Up @@ -284,22 +285,21 @@ func addDomainAccountCredential(
func updateDomainAccountCredential(
ctx context.Context, d *schema.ResourceData, m interface{},
) error {

// Extract the client from the meta parameter
client, ok := m.(*Client)
if !ok {
return fmt.Errorf("failed to cast interface to *Client")
return errors.New("failed to cast interface to *Client")
}

// Get the account ID and domain ID from the resource data
accountID, ok := d.Get("account_id").(string)
if !ok {
return fmt.Errorf("failed to get account_id from resource data")
return errors.New("failed to get account_id from resource data")
}

domainID, ok := d.Get("domain_id").(string)
if !ok {
return fmt.Errorf("failed to get domain_id from resource data")
return errors.New("failed to get domain_id from resource data")
}

// Check the value of propagate_credential_change option
Expand All @@ -317,7 +317,7 @@ func updateDomainAccountCredential(
// Make the appropriate request based on the propagate_credential_change value
body, code, err := client.newRequest(ctx, url, http.MethodPut, jsonData)
if err != nil {
return fmt.Errorf("request failed: %v", err)
return fmt.Errorf("request failed: %w", err)
}

if code != http.StatusOK && code != http.StatusNoContent {
Expand Down

0 comments on commit 9011ef9

Please sign in to comment.