Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart-Kuipers committed Jan 16, 2025
1 parent a71b747 commit 3b74e5d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions commercelayer/resource_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ func resourceMarket() *schema.Resource {
Computed: true,
},
"shared_secret": {
Description: "The shared secret generated at the market level that can be used to verify that callbacks are coming from CommerceLayer.",
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
Description: "The shared secret generated at the market level that can be used to verify that callbacks are coming from CommerceLayer.",
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
"attributes": {
Description: "Resource attributes",
Type: schema.TypeList,
Expand Down Expand Up @@ -158,9 +158,9 @@ func resourceMarketReadFunc(ctx context.Context, d *schema.ResourceData, i inter

d.SetId(Market.GetId().(string))

MarketAttributes := Market.GetAttributes()
MarketAttributes := Market.GetAttributes()

d.Set("shared_secret", MarketAttributes.GetSharedSecret().(string))
d.Set("shared_secret", MarketAttributes.GetSharedSecret().(string))

Check failure on line 163 in commercelayer/resource_market.go

View workflow job for this annotation

GitHub Actions / test

Error return value of `d.Set` is not checked (errcheck)

return nil
}
Expand Down Expand Up @@ -239,13 +239,13 @@ func resourceMarketCreateFunc(ctx context.Context, d *schema.ResourceData, i int

d.SetId(market.Data.GetId().(string))

// Market needs to be fetched again to get the shared secret. The create call does return it but the CL
// OpenApi spec does not have it in the response so the SDK does not have a method to retrieve it.
// Market needs to be fetched again to get the shared secret. The create call does return it but the CL
// OpenApi spec does not have it in the response so the SDK does not have a method to retrieve it.
refetchedMarket, _, refetchMarketErr := c.MarketsApi.GETMarketsMarketId(ctx, market.Data.GetId()).Execute()

if refetchMarketErr != nil {
return diagErr(refetchMarketErr)
}
return diagErr(refetchMarketErr)
}

marketAttributes := refetchedMarket.Data.GetAttributes()
d.Set("shared_secret", marketAttributes.GetSharedSecret().(string))

Check failure on line 251 in commercelayer/resource_market.go

View workflow job for this annotation

GitHub Actions / test

Error return value of `d.Set` is not checked (errcheck)
Expand Down

0 comments on commit 3b74e5d

Please sign in to comment.