@@ -280,7 +280,7 @@ func (c *Client) doWithBackoff(
280280 request .Header = headers .Clone ()
281281
282282 //nolint:bodyclose // This response is returned to the caller.
283- response , err = c .Client . Do (request )
283+ response , err = c .Do (request )
284284 }
285285
286286 // An error indicates there was no response from the server, and the
@@ -327,7 +327,7 @@ func (c *Client) doWithRetry(
327327 // Retry the request when the server responds with "Too many requests".
328328 // - https://docs.crunchybridge.com/api-concepts/getting-started/#status-codes
329329 // - https://docs.crunchybridge.com/api-concepts/getting-started/#rate-limiting
330- for err == nil && response .StatusCode == 429 {
330+ for err == nil && response .StatusCode == http . StatusTooManyRequests {
331331 seconds , _ := strconv .Atoi (response .Header .Get ("Retry-After" ))
332332
333333 // Only retry when the response indicates how long to wait.
@@ -378,11 +378,11 @@ func (c *Client) CreateAuthObject(ctx context.Context, authn AuthObject) (AuthOb
378378 }
379379
380380 // 401, Unauthorized
381- case response .StatusCode == 401 :
381+ case response .StatusCode == http . StatusUnauthorized :
382382 err = fmt .Errorf ("%w: %s" , errAuthentication , body )
383383
384384 default :
385- //nolint:goerr113 // This is intentionally dynamic.
385+ //nolint:err113 // This is intentionally dynamic.
386386 err = fmt .Errorf ("%v: %s" , response .Status , body )
387387 }
388388 }
@@ -409,7 +409,7 @@ func (c *Client) CreateInstallation(ctx context.Context) (Installation, error) {
409409 }
410410
411411 default :
412- //nolint:goerr113 // This is intentionally dynamic.
412+ //nolint:err113 // This is intentionally dynamic.
413413 err = fmt .Errorf ("%v: %s" , response .Status , body )
414414 }
415415 }
@@ -445,7 +445,7 @@ func (c *Client) ListClusters(ctx context.Context, apiKey, teamId string) ([]*Cl
445445 }
446446
447447 default :
448- //nolint:goerr113 // This is intentionally dynamic.
448+ //nolint:err113 // This is intentionally dynamic.
449449 err = fmt .Errorf ("%v: %s" , response .Status , body )
450450 }
451451 }
@@ -486,7 +486,7 @@ func (c *Client) CreateCluster(
486486 }
487487
488488 default :
489- //nolint:goerr113 // This is intentionally dynamic.
489+ //nolint:err113 // This is intentionally dynamic.
490490 err = fmt .Errorf ("%v: %s" , response .Status , body )
491491 }
492492 }
@@ -524,14 +524,14 @@ func (c *Client) DeleteCluster(ctx context.Context, apiKey, id string) (*Cluster
524524 // --https://docs.crunchybridge.com/api-concepts/idempotency#delete-semantics
525525 // But also, if we can't find it...
526526 // Maybe if no ID we return already deleted?
527- case response .StatusCode == 410 :
527+ case response .StatusCode == http . StatusGone :
528528 fallthrough
529- case response .StatusCode == 404 :
529+ case response .StatusCode == http . StatusNotFound :
530530 deletedAlready = true
531531 err = nil
532532
533533 default :
534- //nolint:goerr113 // This is intentionally dynamic.
534+ //nolint:err113 // This is intentionally dynamic.
535535 err = fmt .Errorf ("%v: %s" , response .Status , body )
536536 }
537537 }
@@ -565,7 +565,7 @@ func (c *Client) GetCluster(ctx context.Context, apiKey, id string) (*ClusterApi
565565 }
566566
567567 default :
568- //nolint:goerr113 // This is intentionally dynamic.
568+ //nolint:err113 // This is intentionally dynamic.
569569 err = fmt .Errorf ("%v: %s" , response .Status , body )
570570 }
571571 }
@@ -599,7 +599,7 @@ func (c *Client) GetClusterStatus(ctx context.Context, apiKey, id string) (*Clus
599599 }
600600
601601 default :
602- //nolint:goerr113 // This is intentionally dynamic.
602+ //nolint:err113 // This is intentionally dynamic.
603603 err = fmt .Errorf ("%v: %s" , response .Status , body )
604604 }
605605 }
@@ -633,7 +633,7 @@ func (c *Client) GetClusterUpgrade(ctx context.Context, apiKey, id string) (*Clu
633633 }
634634
635635 default :
636- //nolint:goerr113 // This is intentionally dynamic.
636+ //nolint:err113 // This is intentionally dynamic.
637637 err = fmt .Errorf ("%v: %s" , response .Status , body )
638638 }
639639 }
@@ -674,7 +674,7 @@ func (c *Client) UpgradeCluster(
674674 }
675675
676676 default :
677- //nolint:goerr113 // This is intentionally dynamic.
677+ //nolint:err113 // This is intentionally dynamic.
678678 err = fmt .Errorf ("%v: %s" , response .Status , body )
679679 }
680680 }
@@ -709,7 +709,7 @@ func (c *Client) UpgradeClusterHA(ctx context.Context, apiKey, id, action string
709709 }
710710
711711 default :
712- //nolint:goerr113 // This is intentionally dynamic.
712+ //nolint:err113 // This is intentionally dynamic.
713713 err = fmt .Errorf ("%v: %s" , response .Status , body )
714714 }
715715 }
@@ -747,7 +747,7 @@ func (c *Client) UpdateCluster(
747747 }
748748
749749 default :
750- //nolint:goerr113 // This is intentionally dynamic.
750+ //nolint:err113 // This is intentionally dynamic.
751751 err = fmt .Errorf ("%v: %s" , response .Status , body )
752752 }
753753 }
@@ -777,7 +777,7 @@ func (c *Client) GetClusterRole(ctx context.Context, apiKey, clusterId, roleName
777777 }
778778
779779 default :
780- //nolint:goerr113 // This is intentionally dynamic.
780+ //nolint:err113 // This is intentionally dynamic.
781781 err = fmt .Errorf ("%v: %s" , response .Status , body )
782782 }
783783 }
@@ -807,7 +807,7 @@ func (c *Client) ListClusterRoles(ctx context.Context, apiKey, id string) ([]*Cl
807807 }
808808
809809 default :
810- //nolint:goerr113 // This is intentionally dynamic.
810+ //nolint:err113 // This is intentionally dynamic.
811811 err = fmt .Errorf ("%v: %s" , response .Status , body )
812812 }
813813 }
0 commit comments