From 5375a2ee84c5e2fecc7efba69a350639ec81aba1 Mon Sep 17 00:00:00 2001 From: Kirill Gavrilov Date: Fri, 8 Sep 2023 04:00:31 +0300 Subject: [PATCH] fix lint --- balancer/app/app.go | 4 ++-- pkg/coord/adapter.go | 4 ++-- router/console/console.go | 4 ++-- test/feature/spqr_test.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/balancer/app/app.go b/balancer/app/app.go index 2d990051c..057e1616d 100644 --- a/balancer/app/app.go +++ b/balancer/app/app.go @@ -32,9 +32,9 @@ func NewApp(balancer *balancerPkg.Balancer, cfg config.Balancer) (*App, error) { } shardClusters := map[int]*hasql.Cluster{} - for id, shard := range *shards { + for id := range *shards { shardClusters[id], err = balancerPkg.NewCluster( - shard.Hosts, + (*shards)[id].Hosts, cfg.InstallationDBName, cfg.InstallationUserName, cfg.InstallationPassword, diff --git a/pkg/coord/adapter.go b/pkg/coord/adapter.go index e6d3fa036..265fa82d0 100644 --- a/pkg/coord/adapter.go +++ b/pkg/coord/adapter.go @@ -216,8 +216,8 @@ func (a *adapter) DropShardingRuleAll(ctx context.Context) ([]*shrule.ShardingRu } c := proto.NewShardingRulesServiceClient(a.conn) - c.DropShardingRules(ctx, &proto.DropShardingRuleRequest{Id: ids}) - return rules, nil + _, err = c.DropShardingRules(ctx, &proto.DropShardingRuleRequest{Id: ids}) + return rules, err } func (a *adapter) ListShardingRules(ctx context.Context) ([]*shrule.ShardingRule, error) { diff --git a/router/console/console.go b/router/console/console.go index c7f9ee39d..a91752555 100644 --- a/router/console/console.go +++ b/router/console/console.go @@ -89,7 +89,7 @@ func (l *Local) proxyProc(ctx context.Context, tstmt spqrparser.Statement, cli * if err != nil { return err } - conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) + conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all if err != nil { return err } @@ -102,7 +102,7 @@ func (l *Local) proxyProc(ctx context.Context, tstmt spqrparser.Statement, cli * if err != nil { return err } - conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) + conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all if err != nil { return err } diff --git a/test/feature/spqr_test.go b/test/feature/spqr_test.go index c83ac5805..a6809ae8b 100644 --- a/test/feature/spqr_test.go +++ b/test/feature/spqr_test.go @@ -480,7 +480,7 @@ func (tctx *testContext) stepHostIsStopped(service string) error { return false } addr := strings.Split(output, "\n")[1] - conn, err := grpc.Dial(addr, grpc.WithInsecure()) + conn, err := grpc.Dial(addr, grpc.WithInsecure()) //nolint:all if err != nil { return false }