Skip to content
Snippets Groups Projects
Commit f0c10982 authored by ale's avatar ale
Browse files

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.
parent 193e29e6
No related branches found
No related tags found
No related merge requests found
......@@ -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++
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment