Skip to content

Commit

Permalink
refactor: Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderKon committed Oct 29, 2023
1 parent c6a1824 commit 6dc0ba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions hw09_struct_validator/int_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ func (v IntValidator) Validate(rule string, ruleValue interface{}, checkValue in
return fmt.Errorf("incorrect tag value: %w", errSystemError)
}

if num != checkValue.(int) {
return errValidationNotInPlentyNumbers
if num == checkValue.(int) {
return nil
}

return nil
}
return errValidationNotInPlentyNumbers
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions hw09_struct_validator/string_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ func (v StringValidator) Validate(rule string, ruleValue interface{}, checkValue
if sliceVal == "" {
return fmt.Errorf("incorrect tag value: %w", errSystemError)
}
if sliceVal != checkValue.(string) {
return errValidationNotInPlentyStrings
if sliceVal == checkValue.(string) {
return nil
}
return nil
}
return errValidationNotInPlentyStrings
}

return nil
Expand Down

0 comments on commit 6dc0ba5

Please sign in to comment.