Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
asaskevich committed Aug 17, 2020
1 parent 26e826e commit df4adff
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 104 deletions.
6 changes: 3 additions & 3 deletions numerics.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func IsNonPositive(value float64) bool {
return value <= 0
}

// InRange returns true if value lies between left and right border
// InRangeInt returns true if value lies between left and right border
func InRangeInt(value, left, right interface{}) bool {
value64, _ := ToInt(value)
left64, _ := ToInt(left)
Expand All @@ -52,15 +52,15 @@ func InRangeInt(value, left, right interface{}) bool {
return value64 >= left64 && value64 <= right64
}

// InRange returns true if value lies between left and right border
// InRangeFloat32 returns true if value lies between left and right border
func InRangeFloat32(value, left, right float32) bool {
if left > right {
left, right = right, left
}
return value >= left && value <= right
}

// InRange returns true if value lies between left and right border
// InRangeFloat64 returns true if value lies between left and right border
func InRangeFloat64(value, left, right float64) bool {
if left > right {
left, right = right, left
Expand Down
4 changes: 3 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ type Validator func(str string) bool
// The second parameter should be the context (in the case of validating a struct: the whole object being validated).
type CustomTypeValidator func(i interface{}, o interface{}) bool

// ParamValidator is a wrapper for validator functions that accepts additional parameters.
// ParamValidator is a wrapper for validator functions that accept additional parameters.
type ParamValidator func(str string, params ...string) bool

// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value
type InterfaceParamValidator func(in interface{}, params ...string) bool
type tagOptionsMap map[string]tagOption

Expand Down
Loading

0 comments on commit df4adff

Please sign in to comment.