You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2011/09/20 01:38:39 UTC
svn commit: r1172901 - in /thrift/trunk/lib/go/thrift: thttp_client.go
tsimple_json_protocol_test.go
Author: jfarrell
Date: Mon Sep 19 23:38:39 2011
New Revision: 1172901
URL: http://svn.apache.org/viewvc?rev=1172901&view=rev
Log:
THRIFT-1350: Go library code does not build against latest release
Client: go
Patch: Kyle Consalus
Go has moved it's URL-handling code into a "url" package, patch updates for these new changes.
Modified:
thrift/trunk/lib/go/thrift/thttp_client.go
thrift/trunk/lib/go/thrift/tsimple_json_protocol_test.go
Modified: thrift/trunk/lib/go/thrift/thttp_client.go
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/go/thrift/thttp_client.go?rev=1172901&r1=1172900&r2=1172901&view=diff
==============================================================================
--- thrift/trunk/lib/go/thrift/thttp_client.go (original)
+++ thrift/trunk/lib/go/thrift/thttp_client.go Mon Sep 19 23:38:39 2011
@@ -24,12 +24,13 @@ import (
"http"
"os"
"strconv"
+ "url"
)
type THttpClient struct {
response *http.Response
- url *http.URL
+ url *url.URL
requestBuffer *bytes.Buffer
nsecConnectTimeout int64
nsecReadTimeout int64
@@ -69,20 +70,20 @@ func NewTHttpPostClientTransportFactory(
}
-func NewTHttpClient(url string) (TTransport, os.Error) {
- parsedURL, err := http.ParseURL(url)
+func NewTHttpClient(urlstr string) (TTransport, os.Error) {
+ parsedURL, err := url.Parse(urlstr)
if err != nil {
return nil, err
}
- response, err := http.Get(url)
+ response, err := http.Get(urlstr)
if err != nil {
return nil, err
}
return &THttpClient{response: response, url: parsedURL}, nil
}
-func NewTHttpPostClient(url string) (TTransport, os.Error) {
- parsedURL, err := http.ParseURL(url)
+func NewTHttpPostClient(urlstr string) (TTransport, os.Error) {
+ parsedURL, err := url.Parse(urlstr)
if err != nil {
return nil, err
}
Modified: thrift/trunk/lib/go/thrift/tsimple_json_protocol_test.go
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/go/thrift/tsimple_json_protocol_test.go?rev=1172901&r1=1172900&r2=1172901&view=diff
==============================================================================
--- thrift/trunk/lib/go/thrift/tsimple_json_protocol_test.go (original)
+++ thrift/trunk/lib/go/thrift/tsimple_json_protocol_test.go Mon Sep 19 23:38:39 2011
@@ -578,7 +578,7 @@ func TestWriteSimpleJSONProtocolMap(t *t
if str[0] != '[' || str[len(str)-1] != ']' {
t.Fatalf("Bad value for %s, wrote: %q, in go: %q", thetype, str, DOUBLE_VALUES)
}
- l := strings.Split(str[1:len(str)-1], ",", -1)
+ l := strings.Split(str[1:len(str)-1], ",")
if len(l) < 3 {
t.Fatal("Expected list of at least length 3 for map for metadata, but was of length ", len(l))
}