From f0c109828cfd761d710ad174fdea5ae0708c3b01 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 17 Aug 2018 07:37:59 +0100 Subject: [PATCH] Flip ordering of path/shard args to Call To match the previous calling convention for DoJSONHTTPRequest and reduce confusion when migrating from the old API. --- clientutil/backend_test.go | 2 +- clientutil/balancer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clientutil/backend_test.go b/clientutil/backend_test.go index ac11093..561f5be 100644 --- a/clientutil/backend_test.go +++ b/clientutil/backend_test.go @@ -161,7 +161,7 @@ func doJSONRequests(backends *testBackends, u string, n int, shards []string) (i if len(shards) > 0 { shard = shards[rand.Intn(len(shards))] } - err = b.Call(ctx, "/", shard, struct{}{}, &resp) + err = b.Call(ctx, shard, "/", struct{}{}, &resp) cancel() if err != nil { errs++ diff --git a/clientutil/balancer.go b/clientutil/balancer.go index 1f6df88..9d9b7dd 100644 --- a/clientutil/balancer.go +++ b/clientutil/balancer.go @@ -97,7 +97,7 @@ func newBalancedBackend(config *BackendConfig, resolver resolver) (*balancedBack // Call the backend. Makes an HTTP POST request to the specified uri, // with a JSON-encoded request body. It will attempt to decode the // response body as JSON. -func (b *balancedBackend) Call(ctx context.Context, path, shard string, req, resp interface{}) error { +func (b *balancedBackend) Call(ctx context.Context, shard, path string, req, resp interface{}) error { data, err := json.Marshal(req) if err != nil { return err -- GitLab