mirror of
https://github.com/redis/go-redis.git
synced 2025-06-15 12:41:41 +03:00
Handle IPv6 in isMovedError (#2981)
* Handle IPv6 in isMovedError * Simplify GetAddr --------- Co-authored-by: Monkey <golang@88.com>
This commit is contained in:
3
error.go
3
error.go
@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/redis/go-redis/v9/internal"
|
||||
"github.com/redis/go-redis/v9/internal/pool"
|
||||
"github.com/redis/go-redis/v9/internal/proto"
|
||||
)
|
||||
@ -129,7 +130,9 @@ func isMovedError(err error) (moved bool, ask bool, addr string) {
|
||||
if ind == -1 {
|
||||
return false, false, ""
|
||||
}
|
||||
|
||||
addr = s[ind+1:]
|
||||
addr = internal.GetAddr(addr)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user