Skip to content

Commit 8b1e334

Browse files
denikIsaac
andcommitted
Use errors.AsType instead of errors.As
golangci forbidigo requires errors.AsType[T] (Go 1.26+). Co-authored-by: Isaac <[email protected]>
1 parent 5f0be91 commit 8b1e334

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎libs/iamutil/current_user.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ func GetCurrentUser(ctx context.Context, w *databricks.WorkspaceClient) (*iam.Us
3030
if err == nil {
3131
return user, nil
3232
}
33-
var apiErr *apierr.APIError
34-
if errors.As(err, &apiErr) && apiErr.StatusCode == http.StatusInternalServerError {
33+
if apiErr, ok := errors.AsType[*apierr.APIError](err); ok && apiErr.StatusCode == http.StatusInternalServerError {
3534
return nil, retries.Continue(err)
3635
}
3736
return nil, retries.Halt(err)

0 commit comments

Comments
 (0)