Code

Fixed compatibility issues with Go 1.0 and 1.1. master
authorSebastian Harl <sh@tokkee.org>
Wed, 13 May 2015 07:57:20 +0000 (09:57 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 13 May 2015 07:57:20 +0000 (09:57 +0200)
client/client.go
client/query.go

index cae54437a1880aa8891090d08856559eaea98773..e6a13030f1415256128f3ee18705a700a52f44b2 100644 (file)
@@ -175,6 +175,9 @@ func (c *Client) Call(req *proto.Message) (*proto.Message, error) {
                        log.Println(string(res.Raw[4:]))
                }
        }
+
+       // Not reached; needed for Go1 compatibility.
+       return nil, nil
 }
 
 // ServerVersion queries and returns the version of the remote server.
index d1224f40f73cc79ecc6dba3d12154f4ba19c8cd0..7bf503477d56a81c69e16090f06d1a8332ff1fbf 100644 (file)
@@ -66,7 +66,7 @@ func stringify(values ...interface{}) ([]interface{}, error) {
 // string. Let's just assume that this pattern never occurs in a real query
 // string (or else, users will have to work around this by not using
 // QueryString()).
-var badArgRE = regexp.MustCompile(`%!.?\(.+`)
+var badArgRE = regexp.MustCompile(`%!?[A-Za-z]?\(.+`)
 
 // QueryString formats a query string. The query q may include printf string
 // verbs (%s) for each argument. The arguments may be of type Identifier,