Skip to content

chore(lint): apierror AsType + accesscontrol godoc/any#68

Merged
0xmanhnv merged 1 commit into
developfrom
chore/lint-cleanup-apierror-accesscontrol
May 11, 2026
Merged

chore(lint): apierror AsType + accesscontrol godoc/any#68
0xmanhnv merged 1 commit into
developfrom
chore/lint-cleanup-apierror-accesscontrol

Conversation

@0xmanhnv
Copy link
Copy Markdown
Collaborator

Summary

  • apierror.IsAPIError / FromError use errors.AsType[*Error] (Go 1.26+) instead of errors.As(err, &apiErr) boilerplate
  • internal/app/accesscontrol: add package doc comment (ST1000)
  • UpdateGroupMemberRoleInput godoc subject matches the type name (ST1020)
  • group_sync.go: map[string]interface{}map[string]any (ST1019)

All three were flagged by staticcheck on PR review. No behavior change.

Test plan

  • go build ./...
  • staticcheck ./pkg/apierror/... ./internal/app/accesscontrol/... clean

…GroupMemberRoleInput godoc

Three small staticcheck cleanups requested by reviewers:

apierror/apierror.go (errors.AsType simplification, Go 1.26+)
  IsAPIError / FromError were doing the boilerplate
    var apiErr *Error
    errors.As(err, &apiErr)
  Switched to the generic helper available since 1.26:
    _, ok := errors.AsType[*Error](err)
    apiErr, ok := errors.AsType[*Error](err)
  Same semantics, fewer lines, no extra allocation.

accesscontrol/group.go
  - Added package doc comment (S1000 / ST1000 — at least one file
    per package must carry a package doc).
  - UpdateGroupMemberRoleInput godoc subject corrected from
    "UpdateMemberRoleInput" (the now-renamed type) to match the
    actual symbol name. ST1020.

accesscontrol/group_sync.go
  - map[string]interface{} → map[string]any. Drive-by ST1019.

No behavior change. Build + staticcheck clean on both touched packages.
@0xmanhnv 0xmanhnv merged commit 98967ac into develop May 11, 2026
13 checks passed
@0xmanhnv 0xmanhnv deleted the chore/lint-cleanup-apierror-accesscontrol branch May 11, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant