Skip to content

Commit

Permalink
chore: errcount shorthand (#58)
Browse files Browse the repository at this point in the history
Use Shorthand Increment Operator: Replace `errcount += 1` with `errcount++`, as it is a more concise and conventional way to increment an integer by 1 in Go. This minor refactoring improves code readability and aligns with common Go practices.

Ref: #42

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam authored Jan 24, 2025
1 parent a6677cf commit b00f642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resource_vmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func resourceVmcCreate(ctx context.Context, d *schema.ResourceData, m interface{
// Attempt to bypass recurring situation where the HCX API
// returns status 502 with a proxy server error, and an HTML response
// instead of JSON.
errcount += 1
errcount++
hclog.Default().Info("[INFO] - resourceVmcCreate() - Error retrieving SDDC status: ", "error", err.Error(), "Errcount:", errcount)
if errcount > 12 {
return diag.FromErr(err)
Expand Down Expand Up @@ -230,7 +230,7 @@ func resourceVmcDelete(ctx context.Context, d *schema.ResourceData, m interface{
// Attempt to bypass recurring situation where the HCX API
// returns status 502 with a proxy server error, and an HTML response
// instead of JSON.
errcount += 1
errcount++
hclog.Default().Info("[INFO] - resourceVmcDelete() - Error retrieving SDDC status: ", "error", err.Error(), "Errcount:", errcount)
if errcount > 12 {
return diag.FromErr(err)
Expand Down

0 comments on commit b00f642

Please sign in to comment.