Fix build errors

This commit is contained in:
Gregory Eremin 2014-09-16 15:58:32 +04:00
parent 5edd23278d
commit 030af0a7b0

View File

@ -1,10 +1,10 @@
package client package client
import ( import (
"net"
"bytes" "bytes"
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
"net"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
@ -81,13 +81,16 @@ func (c *Client) Subscribe(queues ...string) (m *Message) {
url := c.url(subscribeEndpoint, "?queues=", strings.Join(queues, ",")) url := c.url(subscribeEndpoint, "?queues=", strings.Join(queues, ","))
transport := http.Transport{ transport := http.Transport{
Dial: net.DialTimeout(network, addr, timeout), Dial: func(network, addr string) (net.Conn, error) {
return net.DialTimeout("tcp", addr, c.Config.Timeout)
},
} }
rdr := bytes.NewReader([]byte) client := http.Client{
req := http.NewRequest("GET", url, rdr) Transport: &transport,
req. }
res, err := http.Get(url)
res, err := client.Get(url)
if err != nil { if err != nil {
return return
} }