Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions pkg/errors/dict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ func TestErrorConfigFluentMethods(t *testing.T) {

// Start with nil and chain fluent methods
config := (*errors.ErrorConfig)(nil).
WithMessage("short", "long").
WithDocs("https://docs.example.com").
WithTrace("https://trace.example.com").
WithErrorMessage("short", "long").
WithDocsURI("https://docs.example.com").
WithTraceURI("https://trace.example.com").
WithCode(code).
WithMeta("key1", "value1").
WithMeta("key2", "value2")
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestErrorConfigFluentMethodsChaining(t *testing.T) {
}

// Child overrides some values
merged := parent.WithMessage("child short", "").WithDocs("https://child.com/docs")
merged := parent.WithErrorMessage("child short", "").WithDocsURI("https://child.com/docs")

// Child takes precedence for Short
if merged.Short != "child short" {
Expand Down Expand Up @@ -219,14 +219,14 @@ func TestErrorConfigFluentMethodsNilReceiver(t *testing.T) {
var config *errors.ErrorConfig

// All methods should work on nil receiver
if result := config.WithMessage("short", "long"); result.Short != "short" {
t.Error("WithMessage should work on nil receiver")
if result := config.WithErrorMessage("short", "long"); result.Short != "short" {
t.Error("WithErrorMessage should work on nil receiver")
}
if result := config.WithDocs("docs"); result.DocsURI != "docs" {
t.Error("WithDocs should work on nil receiver")
if result := config.WithDocsURI("docs"); result.DocsURI != "docs" {
t.Error("WithDocsURI should work on nil receiver")
}
if result := config.WithTrace("trace"); result.TraceURI != "trace" {
t.Error("WithTrace should work on nil receiver")
if result := config.WithTraceURI("trace"); result.TraceURI != "trace" {
t.Error("WithTraceURI should work on nil receiver")
}
code := errors.ErrorCode("CODE")
if result := config.WithCode(code); result.Code == nil || *result.Code != code {
Expand Down
12 changes: 6 additions & 6 deletions pkg/errors/error_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ type ErrorConfigurable[T any, Self any] interface {
WithErrorCallback(fn ErrorCallback) Self
}

// WithMessage returns a new ErrorConfig with the given short and long messages merged.
// WithErrorMessage returns a new ErrorConfig with the given short and long messages merged.
// This method is nil-receiver safe.
func (c *ErrorConfig) WithMessage(short, long string) *ErrorConfig {
func (c *ErrorConfig) WithErrorMessage(short, long string) *ErrorConfig {
return mergeErrorConfig(c, &ErrorConfig{Short: short, Long: long})
}

// WithDocs returns a new ErrorConfig with the given documentation URI merged.
// WithDocsURI returns a new ErrorConfig with the given documentation URI merged.
// This method is nil-receiver safe.
func (c *ErrorConfig) WithDocs(uri string) *ErrorConfig {
func (c *ErrorConfig) WithDocsURI(uri string) *ErrorConfig {
return mergeErrorConfig(c, &ErrorConfig{DocsURI: uri})
}

// WithTrace returns a new ErrorConfig with the given trace URI merged.
// WithTraceURI returns a new ErrorConfig with the given trace URI merged.
// This method is nil-receiver safe.
func (c *ErrorConfig) WithTrace(uri string) *ErrorConfig {
func (c *ErrorConfig) WithTraceURI(uri string) *ErrorConfig {
return mergeErrorConfig(c, &ErrorConfig{TraceURI: uri})
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/any.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ func (ruleSet *AnyRuleSet) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *AnyRuleSet) WithErrorMessage(short, long string) *AnyRuleSet {
return v.clone(anyWithLabel(util.FormatErrorMessageLabel(short, long)), anyWithErrorConfig(v.errorConfig.WithMessage(short, long)))
return v.clone(anyWithLabel(util.FormatErrorMessageLabel(short, long)), anyWithErrorConfig(v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *AnyRuleSet) WithDocsURI(uri string) *AnyRuleSet {
return v.clone(anyWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), anyWithErrorConfig(v.errorConfig.WithDocs(uri)))
return v.clone(anyWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), anyWithErrorConfig(v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *AnyRuleSet) WithTraceURI(uri string) *AnyRuleSet {
return v.clone(anyWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), anyWithErrorConfig(v.errorConfig.WithTrace(uri)))
return v.clone(anyWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), anyWithErrorConfig(v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,17 @@ func (ruleSet *BoolRuleSet) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *BoolRuleSet) WithErrorMessage(short, long string) *BoolRuleSet {
return v.clone(boolWithLabel("WithErrorMessage(...)"), boolWithErrorConfig(v.errorConfig.WithMessage(short, long)))
return v.clone(boolWithLabel("WithErrorMessage(...)"), boolWithErrorConfig(v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *BoolRuleSet) WithDocsURI(uri string) *BoolRuleSet {
return v.clone(boolWithLabel("WithDocsURI(...)"), boolWithErrorConfig(v.errorConfig.WithDocs(uri)))
return v.clone(boolWithLabel("WithDocsURI(...)"), boolWithErrorConfig(v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *BoolRuleSet) WithTraceURI(uri string) *BoolRuleSet {
return v.clone(boolWithLabel("WithTraceURI(...)"), boolWithErrorConfig(v.errorConfig.WithTrace(uri)))
return v.clone(boolWithLabel("WithTraceURI(...)"), boolWithErrorConfig(v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ func (ruleSet *ConstantRuleSet[T]) Value() T {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (ruleSet *ConstantRuleSet[T]) WithErrorMessage(short, long string) *ConstantRuleSet[T] {
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithMessage(short, long)))
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (ruleSet *ConstantRuleSet[T]) WithDocsURI(uri string) *ConstantRuleSet[T] {
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithDocs(uri)))
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (ruleSet *ConstantRuleSet[T]) WithTraceURI(uri string) *ConstantRuleSet[T] {
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithTrace(uri)))
return ruleSet.clone(constantWithErrorConfig[T](ruleSet.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,17 @@ func (ruleSet *FloatRuleSet[T]) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *FloatRuleSet[T]) WithErrorMessage(short, long string) *FloatRuleSet[T] {
return v.clone(floatWithLabel[T](util.FormatErrorMessageLabel(short, long)), floatWithErrorConfig[T](v.errorConfig.WithMessage(short, long)))
return v.clone(floatWithLabel[T](util.FormatErrorMessageLabel(short, long)), floatWithErrorConfig[T](v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *FloatRuleSet[T]) WithDocsURI(uri string) *FloatRuleSet[T] {
return v.clone(floatWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), floatWithErrorConfig[T](v.errorConfig.WithDocs(uri)))
return v.clone(floatWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), floatWithErrorConfig[T](v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *FloatRuleSet[T]) WithTraceURI(uri string) *FloatRuleSet[T] {
return v.clone(floatWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), floatWithErrorConfig[T](v.errorConfig.WithTrace(uri)))
return v.clone(floatWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), floatWithErrorConfig[T](v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/inerface.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ func (ruleSet *InterfaceRuleSet[T]) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *InterfaceRuleSet[T]) WithErrorMessage(short, long string) *InterfaceRuleSet[T] {
return v.clone(interfaceWithLabel[T](util.FormatErrorMessageLabel(short, long)), interfaceWithErrorConfig[T](v.errorConfig.WithMessage(short, long)))
return v.clone(interfaceWithLabel[T](util.FormatErrorMessageLabel(short, long)), interfaceWithErrorConfig[T](v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *InterfaceRuleSet[T]) WithDocsURI(uri string) *InterfaceRuleSet[T] {
return v.clone(interfaceWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), interfaceWithErrorConfig[T](v.errorConfig.WithDocs(uri)))
return v.clone(interfaceWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), interfaceWithErrorConfig[T](v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *InterfaceRuleSet[T]) WithTraceURI(uri string) *InterfaceRuleSet[T] {
return v.clone(interfaceWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), interfaceWithErrorConfig[T](v.errorConfig.WithTrace(uri)))
return v.clone(interfaceWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), interfaceWithErrorConfig[T](v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,17 +434,17 @@ func (ruleSet *IntRuleSet[T]) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *IntRuleSet[T]) WithErrorMessage(short, long string) *IntRuleSet[T] {
return v.clone(intWithLabel[T](util.FormatErrorMessageLabel(short, long)), intWithErrorConfig[T](v.errorConfig.WithMessage(short, long)))
return v.clone(intWithLabel[T](util.FormatErrorMessageLabel(short, long)), intWithErrorConfig[T](v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *IntRuleSet[T]) WithDocsURI(uri string) *IntRuleSet[T] {
return v.clone(intWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), intWithErrorConfig[T](v.errorConfig.WithDocs(uri)))
return v.clone(intWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), intWithErrorConfig[T](v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *IntRuleSet[T]) WithTraceURI(uri string) *IntRuleSet[T] {
return v.clone(intWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), intWithErrorConfig[T](v.errorConfig.WithTrace(uri)))
return v.clone(intWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), intWithErrorConfig[T](v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/net/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,17 @@ func (ruleSet *DomainRuleSet) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (ruleSet *DomainRuleSet) WithErrorMessage(short, long string) *DomainRuleSet {
return ruleSet.clone(domainWithLabel(util.FormatErrorMessageLabel(short, long)), domainWithErrorConfig(ruleSet.errorConfig.WithMessage(short, long)))
return ruleSet.clone(domainWithLabel(util.FormatErrorMessageLabel(short, long)), domainWithErrorConfig(ruleSet.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (ruleSet *DomainRuleSet) WithDocsURI(uri string) *DomainRuleSet {
return ruleSet.clone(domainWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), domainWithErrorConfig(ruleSet.errorConfig.WithDocs(uri)))
return ruleSet.clone(domainWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), domainWithErrorConfig(ruleSet.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (ruleSet *DomainRuleSet) WithTraceURI(uri string) *DomainRuleSet {
return ruleSet.clone(domainWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), domainWithErrorConfig(ruleSet.errorConfig.WithTrace(uri)))
return ruleSet.clone(domainWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), domainWithErrorConfig(ruleSet.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/net/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,17 @@ func (ruleSet *EmailRuleSet) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (ruleSet *EmailRuleSet) WithErrorMessage(short, long string) *EmailRuleSet {
return ruleSet.clone(emailWithLabel(util.FormatErrorMessageLabel(short, long)), emailWithErrorConfig(ruleSet.errorConfig.WithMessage(short, long)))
return ruleSet.clone(emailWithLabel(util.FormatErrorMessageLabel(short, long)), emailWithErrorConfig(ruleSet.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (ruleSet *EmailRuleSet) WithDocsURI(uri string) *EmailRuleSet {
return ruleSet.clone(emailWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), emailWithErrorConfig(ruleSet.errorConfig.WithDocs(uri)))
return ruleSet.clone(emailWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), emailWithErrorConfig(ruleSet.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (ruleSet *EmailRuleSet) WithTraceURI(uri string) *EmailRuleSet {
return ruleSet.clone(emailWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), emailWithErrorConfig(ruleSet.errorConfig.WithTrace(uri)))
return ruleSet.clone(emailWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), emailWithErrorConfig(ruleSet.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/net/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,17 +334,17 @@ func (ruleSet *IPRuleSet) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (ruleSet *IPRuleSet) WithErrorMessage(short, long string) *IPRuleSet {
return ruleSet.clone(ipWithLabel(util.FormatErrorMessageLabel(short, long)), ipWithErrorConfig(ruleSet.errorConfig.WithMessage(short, long)))
return ruleSet.clone(ipWithLabel(util.FormatErrorMessageLabel(short, long)), ipWithErrorConfig(ruleSet.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (ruleSet *IPRuleSet) WithDocsURI(uri string) *IPRuleSet {
return ruleSet.clone(ipWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), ipWithErrorConfig(ruleSet.errorConfig.WithDocs(uri)))
return ruleSet.clone(ipWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), ipWithErrorConfig(ruleSet.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (ruleSet *IPRuleSet) WithTraceURI(uri string) *IPRuleSet {
return ruleSet.clone(ipWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), ipWithErrorConfig(ruleSet.errorConfig.WithTrace(uri)))
return ruleSet.clone(ipWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), ipWithErrorConfig(ruleSet.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/net/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,17 +808,17 @@ func uriWithConflictType(ct uriConflictType) uriCloneOption {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (ruleSet *URIRuleSet) WithErrorMessage(short, long string) *URIRuleSet {
return ruleSet.clone(uriWithLabel(util.FormatErrorMessageLabel(short, long)), uriWithErrorConfig(ruleSet.errorConfig.WithMessage(short, long)))
return ruleSet.clone(uriWithLabel(util.FormatErrorMessageLabel(short, long)), uriWithErrorConfig(ruleSet.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (ruleSet *URIRuleSet) WithDocsURI(uri string) *URIRuleSet {
return ruleSet.clone(uriWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), uriWithErrorConfig(ruleSet.errorConfig.WithDocs(uri)))
return ruleSet.clone(uriWithLabel(util.FormatStringArgLabel("WithDocsURI", uri)), uriWithErrorConfig(ruleSet.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (ruleSet *URIRuleSet) WithTraceURI(uri string) *URIRuleSet {
return ruleSet.clone(uriWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), uriWithErrorConfig(ruleSet.errorConfig.WithTrace(uri)))
return ruleSet.clone(uriWithLabel(util.FormatStringArgLabel("WithTraceURI", uri)), uriWithErrorConfig(ruleSet.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -951,17 +951,17 @@ func (ruleSet *ObjectRuleSet[T, TK, TV]) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *ObjectRuleSet[T, TK, TV]) WithErrorMessage(short, long string) *ObjectRuleSet[T, TK, TV] {
return v.clone(objectWithLabel[T, TK, TV](util.FormatErrorMessageLabel(short, long)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithMessage(short, long)))
return v.clone(objectWithLabel[T, TK, TV](util.FormatErrorMessageLabel(short, long)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *ObjectRuleSet[T, TK, TV]) WithDocsURI(uri string) *ObjectRuleSet[T, TK, TV] {
return v.clone(objectWithLabel[T, TK, TV](util.FormatStringArgLabel("WithDocsURI", uri)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithDocs(uri)))
return v.clone(objectWithLabel[T, TK, TV](util.FormatStringArgLabel("WithDocsURI", uri)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *ObjectRuleSet[T, TK, TV]) WithTraceURI(uri string) *ObjectRuleSet[T, TK, TV] {
return v.clone(objectWithLabel[T, TK, TV](util.FormatStringArgLabel("WithTraceURI", uri)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithTrace(uri)))
return v.clone(objectWithLabel[T, TK, TV](util.FormatStringArgLabel("WithTraceURI", uri)), objectWithErrorConfig[T, TK, TV](v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
6 changes: 3 additions & 3 deletions pkg/rules/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,17 +650,17 @@ func (ruleSet *SliceRuleSet[T]) String() string {

// WithErrorMessage returns a new RuleSet with custom short and long error messages.
func (v *SliceRuleSet[T]) WithErrorMessage(short, long string) *SliceRuleSet[T] {
return v.clone(sliceWithLabel[T](util.FormatErrorMessageLabel(short, long)), sliceWithErrorConfig[T](v.errorConfig.WithMessage(short, long)))
return v.clone(sliceWithLabel[T](util.FormatErrorMessageLabel(short, long)), sliceWithErrorConfig[T](v.errorConfig.WithErrorMessage(short, long)))
}

// WithDocsURI returns a new RuleSet with a custom documentation URI.
func (v *SliceRuleSet[T]) WithDocsURI(uri string) *SliceRuleSet[T] {
return v.clone(sliceWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), sliceWithErrorConfig[T](v.errorConfig.WithDocs(uri)))
return v.clone(sliceWithLabel[T](util.FormatStringArgLabel("WithDocsURI", uri)), sliceWithErrorConfig[T](v.errorConfig.WithDocsURI(uri)))
}

// WithTraceURI returns a new RuleSet with a custom trace/debug URI.
func (v *SliceRuleSet[T]) WithTraceURI(uri string) *SliceRuleSet[T] {
return v.clone(sliceWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), sliceWithErrorConfig[T](v.errorConfig.WithTrace(uri)))
return v.clone(sliceWithLabel[T](util.FormatStringArgLabel("WithTraceURI", uri)), sliceWithErrorConfig[T](v.errorConfig.WithTraceURI(uri)))
}

// WithErrorCode returns a new RuleSet with a custom error code.
Expand Down
Loading