Skip to content

Fix interface godoc: replace sql.ErrNoRows with ErrNotFound in store contracts#26

Merged
veverkap merged 1 commit into
mainfrom
copilot/fix-godoc-comments-error
Apr 17, 2026
Merged

Fix interface godoc: replace sql.ErrNoRows with ErrNotFound in store contracts#26
veverkap merged 1 commit into
mainfrom
copilot/fix-godoc-comments-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

SessionStore and EmailVerificationStore interface method comments referenced sql.ErrNoRows as the not-found return value, directly contradicting the package's own ErrNotFound sentinel contract defined just above them. This mismatch was the root cause of implementors returning the wrong error.

Changes

  • auth/types.go: Updated four method comments to reference ErrNotFound instead of sql.ErrNoRows:
    • SessionStore.FindSessionByID
    • SessionStore.FindSessionByRefreshTokenHash
    • SessionStore.DeleteSession
    • EmailVerificationStore.ConsumeEmailVerification

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates store interface Godoc to consistently document ErrNotFound (the package sentinel error) as the “not found” contract instead of sql.ErrNoRows, aligning implementor expectations with the package’s stated error semantics.

Changes:

  • Updated SessionStore method comments to reference ErrNotFound for not-found behavior.
  • Updated EmailVerificationStore.ConsumeEmailVerification comment to reference ErrNotFound.
Show a summary per file
File Description
auth/types.go Aligns interface method documentation with the package-level ErrNotFound sentinel contract (avoids sql.ErrNoRows in store contracts).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@veverkap veverkap merged commit 86b6949 into main Apr 17, 2026
10 checks passed
@veverkap veverkap deleted the copilot/fix-godoc-comments-error branch April 17, 2026 17:30
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.

3 participants