Skip to content

Commit 4c9a812

Browse files
committed
Refactor errors.As to errors.AsType
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 3b9ce74 commit 4c9a812

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

RESOURCES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The overall status of each resource or data source is captured in this document
9393
| `github_release` | ⚠️ ||||||
9494
| `github_release_asset` | ⚠️ ||||||
9595
| `github_repositories` | ⚠️ ||||||
96-
| `github_repository` | ⚠️ || | | | |
96+
| `github_repository` | || | | | |
9797
| `github_repository_autolink_references` | ⚠️ ||||||
9898
| `github_repository_branches` | ⚠️ ||||||
9999
| `github_repository_custom_properties` | ⚠️ ||||||
@@ -179,7 +179,7 @@ The overall status of each resource or data source is captured in this document
179179
| `github_project_card` (🚫) ||||||||
180180
| `github_project_column` (🚫) ||||||||
181181
| `github_release` ||||||||
182-
| `github_repository` | ⚠️ ||||| ||
182+
| `github_repository` | ||||| ||
183183
| `github_repository_autolink_reference` ||||||||
184184
| `github_repository_collaborator` ||||||||
185185
| `github_repository_collaborators` | ⚠️ |||||||

github/data_source_github_repository.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ func dataSourceGithubRepositoryRead(ctx context.Context, d *schema.ResourceData,
436436

437437
repo, _, err := client.Repositories.Get(ctx, owner, repoName)
438438
if err != nil {
439-
var ghErr *github.ErrorResponse
440-
if errors.As(err, &ghErr) {
439+
if ghErr, ok := errors.AsType[*github.ErrorResponse](err); ok {
441440
if ghErr.Response.StatusCode == http.StatusNotFound {
442441
tflog.Debug(ctx, "Missing GitHub repository", map[string]any{"owner": owner, "repo": repoName})
443442
d.SetId("")

0 commit comments

Comments
 (0)