Skip to content

Commit

Permalink
fix(gvalid): struct name of rule required-if-all
Browse files Browse the repository at this point in the history
  • Loading branch information
cococolanosugar committed Apr 10, 2024
1 parent e31f9d7 commit 5304e10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions util/gvalid/internal/builtin/builtin_required_if_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ import (
"github.com/gogf/gf/v2/util/gutil"
)

// RuleRequiredIfAllEq implements `required-if-all` rule:
// RuleRequiredIfEq implements `required-if-all` rule:
// Required if all given field and its value are equal.
//
// Format: required-if-all:field,value,...
// Example: required-if-all:id,1,age,18
type RuleRequiredIfAllEq struct{}
type RuleRequiredIfEq struct{}

func init() {
Register(RuleRequiredIfAllEq{})
Register(RuleRequiredIfEq{})
}

func (r RuleRequiredIfAllEq) Name() string {
func (r RuleRequiredIfEq) Name() string {
return "required-if-all"
}

func (r RuleRequiredIfAllEq) Message() string {
func (r RuleRequiredIfEq) Message() string {
return "The {field} field is required"
}

func (r RuleRequiredIfAllEq) Run(in RunInput) error {
func (r RuleRequiredIfEq) Run(in RunInput) error {
var (
required = true
array = strings.Split(in.RulePattern, ",")
Expand Down

0 comments on commit 5304e10

Please sign in to comment.