Browse Source

ensure compatibilty with go1.1

Christoph Hack 12 years ago
parent
commit
e9d35a3dfc
2 changed files with 2 additions and 2 deletions
  1. 1 1
      cluster.go
  2. 1 1
      conn_test.go

+ 1 - 1
cluster.go

@@ -63,7 +63,7 @@ func (cfg *ClusterConfig) CreateSession() *Session {
 	impl.wgStart.Add(1)
 	impl.wgStart.Add(1)
 	for i := 0; i < len(impl.cfg.Hosts); i++ {
 	for i := 0; i < len(impl.cfg.Hosts); i++ {
 		addr := strings.TrimSpace(impl.cfg.Hosts[i])
 		addr := strings.TrimSpace(impl.cfg.Hosts[i])
-		if strings.IndexByte(addr, ':') < 0 {
+		if strings.Index(addr, ":") < 0 {
 			addr = fmt.Sprintf("%s:%d", addr, impl.cfg.DefaultPort)
 			addr = fmt.Sprintf("%s:%d", addr, impl.cfg.DefaultPort)
 		}
 		}
 		for j := 0; j < impl.cfg.NumConns; j++ {
 		for j := 0; j < impl.cfg.NumConns; j++ {

+ 1 - 1
conn_test.go

@@ -164,7 +164,7 @@ func (srv *TestServer) process(frame frame, conn net.Conn) {
 		frame = frame[:headerSize]
 		frame = frame[:headerSize]
 		frame.setHeader(protoResponse, 0, frame[2], opResult)
 		frame.setHeader(protoResponse, 0, frame[2], opResult)
 		first := query
 		first := query
-		if n := strings.IndexByte(query, ' '); n > 0 {
+		if n := strings.Index(query, " "); n > 0 {
 			first = first[:n]
 			first = first[:n]
 		}
 		}
 		switch strings.ToLower(first) {
 		switch strings.ToLower(first) {