From 8ad2c882f46df3847454b78dfa6297ad5ef607b1 Mon Sep 17 00:00:00 2001 From: Functionary Robot Date: Fri, 20 Apr 2018 13:37:14 +1000 Subject: [PATCH] secondary/planner: fix error found by vet Vet found the following error: secondary/planner/executor.go:466: comparison of function plan == nil is always false The author clearly meant to test p, not plan. --- secondary/planner/executor.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/secondary/planner/executor.go b/secondary/planner/executor.go index 356bef7d3..5bc68aefd 100644 --- a/secondary/planner/executor.go +++ b/secondary/planner/executor.go @@ -13,15 +13,16 @@ import ( "encoding/json" "errors" "fmt" - "github.com/couchbase/cbauth/service" - "github.com/couchbase/indexing/secondary/common" - "github.com/couchbase/indexing/secondary/logging" "io/ioutil" "math" "math/rand" "os" "strconv" "time" + + "github.com/couchbase/cbauth/service" + "github.com/couchbase/indexing/secondary/common" + "github.com/couchbase/indexing/secondary/logging" ) ////////////////////////////////////////////////////////////// @@ -463,7 +464,7 @@ func execute(config *RunConfig, command CommandType, p *Plan, indexSpecs []*Inde return plan(config, p, indexes) } else if command == CommandRebalance || command == CommandSwap { - if plan == nil { + if p == nil { return nil, nil, errors.New("missing argument: either workload or plan must be present") }