Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nieomylnieja committed Oct 13, 2024
1 parent 14d4090 commit 615837e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions pkg/rules/comparable.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/nobl9/govy/pkg/govy"
)

// EQ ensures the property's value is equal to the compared in.
// EQ ensures the property's value is equal to the compared value.
func EQ[T comparable](compared T) govy.Rule[T] {
msg := fmt.Sprintf(comparisonFmt, cmpEqualTo, compared)
return govy.NewRule(func(v T) error {
Expand All @@ -22,7 +22,7 @@ func EQ[T comparable](compared T) govy.Rule[T] {
WithDescription(msg)
}

// NEQ ensures the property's value is not equal to the compared in.
// NEQ ensures the property's value is not equal to the compared value.
func NEQ[T comparable](compared T) govy.Rule[T] {
msg := fmt.Sprintf(comparisonFmt, cmpNotEqualTo, compared)
return govy.NewRule(func(v T) error {
Expand All @@ -35,25 +35,25 @@ func NEQ[T comparable](compared T) govy.Rule[T] {
WithDescription(msg)
}

// GT ensures the property's value is greater than the compared in.
// GT ensures the property's value is greater than the compared value.
func GT[T constraints.Ordered](compared T) govy.Rule[T] {
return orderedComparisonRule(cmpGreaterThan, compared).
WithErrorCode(ErrorCodeGreaterThan)
}

// GTE ensures the property's value is greater than or equal to the compared in.
// GTE ensures the property's value is greater than or equal to the compared value.
func GTE[T constraints.Ordered](compared T) govy.Rule[T] {
return orderedComparisonRule(cmpGreaterThanOrEqual, compared).
WithErrorCode(ErrorCodeGreaterThanOrEqualTo)
}

// LT ensures the property's value is less than the compared in.
// LT ensures the property's value is less than the compared value.
func LT[T constraints.Ordered](compared T) govy.Rule[T] {
return orderedComparisonRule(cmpLessThan, compared).
WithErrorCode(ErrorCodeLessThan)
}

// LTE ensures the property's value is less than or equal to the compared in.
// LTE ensures the property's value is less than or equal to the compared value.
func LTE[T constraints.Ordered](compared T) govy.Rule[T] {
return orderedComparisonRule(cmpLessThanOrEqual, compared).
WithErrorCode(ErrorCodeLessThanOrEqualTo)
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/forbidden.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/nobl9/govy/pkg/govy"
)

// Forbidden ensures the property's value is its type's zero in, i.e. it's empty.
// Forbidden ensures the property's value is its type's zero value, i.e. it's empty.
func Forbidden[T any]() govy.Rule[T] {
msg := "property is forbidden"
return govy.NewRule(func(v T) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/required.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/nobl9/govy/pkg/govy"
)

// Required ensures the property's value is not empty (i.e. it's not its type's zero in).
// Required ensures the property's value is not empty (i.e. it's not its type's zero value).
func Required[T any]() govy.Rule[T] {
return govy.NewRule(func(v T) error {
if internal.IsEmpty(v) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/rules/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func StringEndsWith(suffixes ...string) govy.Rule[string] {
WithDescription(msg)
}

// StringTitle ensures each word value a string starts with a capital letter.
// StringTitle ensures each word in a string starts with a capital letter.
func StringTitle() govy.Rule[string] {
msg := "each word in a string must start with a capital letter"
return govy.NewRule(func(s string) error {
Expand Down

0 comments on commit 615837e

Please sign in to comment.