Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit c380756

Browse files
authored
Merge pull request #2 from obalunenko/develop
Fix fmt
2 parents 3b9e999 + 15c40fb commit c380756

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

validation.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (row Row) ValidateRow(rec []string) error {
7676

7777
if uint(len(rec)) != row.ColumnsTotalNum {
7878
return fmt.Errorf("invalid row [row:[%v]; columns num:[%d]; should be: [%d]]",
79-
rec, len(rec), row.ColumnsTotalNum)
79+
rec, len(rec), row.ColumnsTotalNum)
8080
}
8181

8282
return row.ColumnsRules.ValidateRow(rec)
@@ -94,7 +94,7 @@ func (rules ValidationRules) ValidateRow(rec []string) error {
9494

9595
for col, rule := range rules {
9696
if err := validateColumn(rec[col.Number], rule); err != nil {
97-
return fmt.Errorf("invalid column [row:%s; column:%s]: %w", rec,col.String(), err)
97+
return fmt.Errorf("invalid column [row:%s; column:%s]: %w", rec, col.String(), err)
9898
}
9999
}
100100

@@ -109,18 +109,18 @@ func validateColumn(data string, rule Rule) error {
109109
if rule.MinLength == rule.MaxLength {
110110
if uint(len(data)) != rule.MinLength {
111111
return fmt.Errorf("invalid length [column:[%s]; has len:[%d]; should be:[%d]]",
112-
data,len(data),rule.MinLength)
112+
data, len(data), rule.MinLength)
113113
}
114114
}
115115

116116
if uint(len(data)) < rule.MinLength {
117117
return fmt.Errorf("invalid length [column:[%s]; has len:[%d]; should be at less[%d]]",
118-
data, len(data),rule.MinLength)
118+
data, len(data), rule.MinLength)
119119
}
120120

121121
if uint(len(data)) > rule.MaxLength && rule.MaxLength != 0 {
122122
return fmt.Errorf("invalid length [column:[%s]; has len:[%d]; should be at less[%d]]",
123-
data, len(data),rule.MaxLength)
123+
data, len(data), rule.MaxLength)
124124
}
125125

126126
if rule.RestrictedChars != nil {

0 commit comments

Comments
 (0)