Skip to content

Commit

Permalink
fix: fix max
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Mar 17, 2023
1 parent 5ed518f commit c4665b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rule/max.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
)

const Max Name = "min"
const NameMax Name = "max"

func StringMax(expected int) StringRule {
return func(ctx context.Context, v string) error {
if len(v) > expected {
return NewError(Max, Meta('d', expected))
return NewError(NameMax, Meta('d', expected))
}
return nil
}
Expand All @@ -18,7 +18,7 @@ func StringMax(expected int) StringRule {
func NumberMax[T Number](expected T) Rule[T] {
return func(ctx context.Context, v T) error {
if v > expected {
return NewError(Max, Meta('d', expected))
return NewError(NameMax, Meta('d', expected))
}
return nil
}
Expand Down
4 changes: 1 addition & 3 deletions rule/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"github.com/foomo/fender/config"
)

const (
NameNumeric Name = "numeric"
)
const NameNumeric Name = "numeric"

var Numeric = Match(NameNumeric.String(), config.RegexNumeric)

0 comments on commit c4665b3

Please sign in to comment.