Address reviews

This commit is contained in:
Adrian Brink
2017-10-17 09:59:05 +02:00
committed by Ethan Buchman
parent 782a836db0
commit 036d3b59a3
6 changed files with 12 additions and 10 deletions

View File

@ -42,7 +42,8 @@ func makeHTTPDialer(remoteAddr string) (string, func(string, string) (net.Conn,
protocol = "tcp"
}
trimmedAddress := strings.Replace(address, "/", ".", -1) // replace / with . for http requests (dummy domain)
// replace / with . for http requests (dummy domain)
trimmedAddress := strings.Replace(address, "/", ".", -1)
return trimmedAddress, func(proto, addr string) (net.Conn, error) {
return net.Dial(protocol, address)
}
@ -67,7 +68,7 @@ type JSONRPCClient struct {
client *http.Client
}
// NewJSONRPCClient takes an address and returns a pointer to an instance of JSONRPCClient
// NewJSONRPCClient returns a JSONRPCClient pointed at the given address.
func NewJSONRPCClient(remote string) *JSONRPCClient {
address, client := makeHTTPClient(remote)
return &JSONRPCClient{