simplicity func jsonRpc2Http(reqs *[]jsonrpc.Request) ([]jsonrpc.Response) { wg := new(sync.WaitGroup) resps := make([]jsonrpc.Response, len(reqs) for i, reqj := range *reqs { wg.Add(1) go func(i int, reqj jsonrpc.Request) { defer wg.Done() reqh := buildHttpRequest(&reqj) resp, _ := HttpClient.Do(reqh) defer resp.Body.Close() body, _ := ioutil.ReadAll(resp.Body) resps[i] = buildJsonRpcResponse(string(body), reqj.ID) }(i, reqj) } wg.Wait() return resps }