config: eliminate duplicate body between UnsupportedField and InvalidValue#8097
config: eliminate duplicate body between UnsupportedField and InvalidValue#8097Copilot wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes duplicated ValidationError construction logic by making UnsupportedField a documented alias that delegates to InvalidValue, keeping both names available for clearer call-site semantics while ensuring future changes to ValidationError only need to be made once.
Changes:
- Refactored
UnsupportedFieldto callInvalidValue(...)instead of duplicating the struct literal. - Added doc comments clarifying
UnsupportedFieldas an alias retained for semantic clarity.
Show a summary per file
| File | Description |
|---|---|
| internal/config/validation_errors.go | Deduplicates ValidationError construction by delegating UnsupportedField to InvalidValue and documents the alias intent. |
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
|
@copilot resolve the merge conflicts in this pull request |
…e-remove-unsupportedfield # Conflicts: # internal/config/validation_errors.go
Resolved. The only conflict was in the doc comment for |
UnsupportedFieldandInvalidValueininternal/config/validation_errors.gohad byte-for-byte identical bodies — any future change toValidationErrorconstruction (e.g. adding aCodefield) would need to be applied twice.Changes
internal/config/validation_errors.go:UnsupportedFieldis now a documented alias that delegates toInvalidValue, removing the duplicate struct literal while preserving both names (both have active call sites invalidation.go)No call sites changed — both function names are retained for semantic clarity (
UnsupportedField= structural/unrecognized field;InvalidValue= constraint violation).