This commit is contained in:
oneao committed 2025-11-04 22:39:02 +08:00
1 parent 69d03709ba
commit 44fb48ef6a
9 files changed
+625 -25

No files matched your search

@@ -0,0 +1,19 @@
package errs
import "fmt"
type ValidationError struct {
field string
message string
}
func (e *ValidationError) Error() string {
return fmt.Sprintf("字段 %s: %s", e.field, e.message)
}
func NewValidationError(field, message string) error {
return &ValidationError{
field: field,
message: message,
}
}