fix(smtp): normalize error messages to Go convention#24
Merged
Conversation
Agent-Logs-Url: https://github.com/amalgamated-tools/goauth/sessions/dd24e849-51ab-460e-9a50-ae4e338c08f7 Co-authored-by: veverkap <22348+veverkap@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
veverkap
April 17, 2026 17:11
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts SMTP configuration validation errors to better align with Go’s error-string conventions (lowercase, no trailing period) within the smtp package.
Changes:
- Lowercased the “host required” validation error returned when
Config.Hostis empty. - Lowercased the “from address required” validation error returned when
Config.Fromis empty.
Show a summary per file
| File | Description |
|---|---|
| smtp/smtp.go | Normalizes two validation error strings returned by Config.Validate(). |
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: 2
Comment on lines
+66
to
+70
| return Params{}, fmt.Errorf("host required") | ||
| } | ||
| from := strings.TrimSpace(c.From) | ||
| if from == "" { | ||
| return Params{}, fmt.Errorf("SMTP from address required") | ||
| return Params{}, fmt.Errorf("from address required") |
There was a problem hiding this comment.
PR description claims SMTP error messages are normalized to Go conventions, but this file still returns several capitalized error prefixes (e.g., "SMTP connection failed", "SMTP client failed", "SMTP auth failed"). Either update those as well or narrow the PR description/scope so it matches the actual changes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Error messages in
smtp/smtp.goviolated Go conventions by using capitalized prefixes ("SMTP host required","SMTP from address required"). Go errors must be lowercase with no trailing period.Changes
smtp/smtp.go: Lowercased two non-conforming error strings to match the style of existing errors in the same function: