From 615837efe609b2535ce8e252f7975afdc6fbd195 Mon Sep 17 00:00:00 2001 From: Mateusz Hawrus Date: Sun, 13 Oct 2024 23:29:13 +0200 Subject: [PATCH] fix typo --- pkg/rules/comparable.go | 12 ++++++------ pkg/rules/forbidden.go | 2 +- pkg/rules/required.go | 2 +- pkg/rules/string.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/rules/comparable.go b/pkg/rules/comparable.go index 66a9032..0429caa 100644 --- a/pkg/rules/comparable.go +++ b/pkg/rules/comparable.go @@ -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 { @@ -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 { @@ -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) diff --git a/pkg/rules/forbidden.go b/pkg/rules/forbidden.go index 3aa6739..c6481c6 100644 --- a/pkg/rules/forbidden.go +++ b/pkg/rules/forbidden.go @@ -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 { diff --git a/pkg/rules/required.go b/pkg/rules/required.go index 695c415..acbdf4c 100644 --- a/pkg/rules/required.go +++ b/pkg/rules/required.go @@ -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) { diff --git a/pkg/rules/string.go b/pkg/rules/string.go index df88b62..a3e33b5 100644 --- a/pkg/rules/string.go +++ b/pkg/rules/string.go @@ -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 {