Skip to content

Commit 3fd4678

Browse files
authored
docs: typos (#1440)
## Fixes Or Enhances This PR fixes a few typos @go-playground/validator-maintainers
1 parent ec374ef commit 3fd4678

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

_examples/struct-level/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func main() {
156156
}
157157

158158
// UserStructLevelValidation contains custom struct level validations that don't always
159-
// make sense at the field validation level. For Example this function validates that either
159+
// make sense at the field validation level. For example, this function validates that either
160160
// FirstName or LastName exist; could have done that with a custom field validation but then
161161
// would have had to add it to both fields duplicating the logic + overhead, this way it's
162162
// only validated once.

doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Same as structonly tag except that any struct level validations will not run.
188188
189189
# Omit Empty
190190
191-
Allows conditional validation, for example if a field is not set with
191+
Allows conditional validation, for example, if a field is not set with
192192
a value (Determined by the "required" validator) then other validation
193193
such as min or max won't run, but if a value is set validation will run.
194194

errors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,24 @@ type FieldError interface {
105105
// StructNamespace returns the namespace for the field error, with the field's
106106
// actual name.
107107
//
108-
// eq. "User.FirstName" see Namespace for comparison
108+
// eg. "User.FirstName" see Namespace for comparison
109109
//
110110
// NOTE: this field can be blank when validating a single primitive field
111111
// using validate.Field(...) as there is no way to extract its name
112112
StructNamespace() string
113113

114-
// Field returns the fields name with the tag name taking precedence over the
114+
// Field returns the field's name with the tag name taking precedence over the
115115
// field's actual name.
116116
//
117117
// `RegisterTagNameFunc` must be registered to get tag value.
118118
//
119-
// eq. JSON name "fname"
119+
// eg. JSON name "fname"
120120
// see StructField for comparison
121121
Field() string
122122

123123
// StructField returns the field's actual name from the struct, when able to determine.
124124
//
125-
// eq. "FirstName"
125+
// eg. "FirstName"
126126
// see Field for comparison
127127
StructField() string
128128

util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ BEGIN:
217217
panic("Invalid field namespace")
218218
}
219219

220-
// asInt returns the parameter as a int64
220+
// asInt returns the parameter as an int64
221221
// or panics if it can't convert
222222
func asInt(param string) int64 {
223223
i, err := strconv.ParseInt(param, 0, 64)

0 commit comments

Comments
 (0)