mirror of
https://github.com/MontFerret/ferret.git
synced 2025-08-13 19:52:52 +02:00
Linter Cleanups (#294)
* sync with MontFerret/ferret * fix --param handling When params is converted to map it uses strings.Split, which slices a string into all substrings separated by :. * remove impossible conditions nil != nil * delete ineffectual assignments * replace '+= 1' with '++' * remove useless comparison with nil * merge variable declarations * remove bool comparison * fix imports * fix imports * delete unused file * use copy instead of loop * delete unused DummyInterface * remove unnecassary break statements * tidy modules
This commit is contained in:
@@ -60,7 +60,7 @@ func NewArrayOperator(
|
||||
return nil, core.Error(core.ErrMissedArgument, "right expression")
|
||||
}
|
||||
|
||||
if IsValidArrayOperatorType(aotype) == false {
|
||||
if !IsValidArrayOperatorType(aotype) {
|
||||
return nil, core.Error(core.ErrInvalidArgument, "operator")
|
||||
}
|
||||
|
||||
|
@@ -58,8 +58,8 @@ func (operator *InOperator) Eval(_ context.Context, left, right core.Value) (cor
|
||||
found := arr.IndexOf(left) > -1
|
||||
|
||||
if operator.not {
|
||||
return values.NewBoolean(found == false), nil
|
||||
return values.NewBoolean(!found), nil
|
||||
}
|
||||
|
||||
return values.NewBoolean(found == true), nil
|
||||
return values.NewBoolean(found), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user