1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-11-06 08:39:09 +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:
3timeslazy
2019-05-04 00:10:34 +03:00
committed by Tim Voronov
parent 69816e8b54
commit acf2f13dcb
50 changed files with 105 additions and 355 deletions

View File

@@ -81,18 +81,14 @@ func main() {
}
}()
dirname := *testsDir
if dirname == "" {
d, err := filepath.Abs(filepath.Dir(os.Args[0]))
if *testsDir == "" {
_, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
logger.Fatal().Timestamp().Err(err).Msg("failed to get testsDir")
return
}
dirname = d
}
r := runner.New(logger, runner.Settings{

View File

@@ -120,7 +120,7 @@ func (r *Runner) runQueries(ctx context.Context, dir string) ([]Result, error) {
n := f.Name()
if r.settings.Filter != nil {
if r.settings.Filter.Match([]byte(n)) != true {
if !r.settings.Filter.Match([]byte(n)) {
continue
}
}
@@ -180,7 +180,7 @@ func (r *Runner) runQuery(ctx context.Context, c *compiler.FqlCompiler, name, sc
runtime.WithParam("dynamic", r.settings.DynamicServerAddress),
)
duration := time.Now().Sub(start)
duration := time.Since(start)
if err != nil {
return Result{