mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Rename copy to clone
This commit is contained in:
@ -703,12 +703,12 @@ func (c *ClusterClient) WithContext(ctx context.Context) *ClusterClient {
|
|||||||
if ctx == nil {
|
if ctx == nil {
|
||||||
panic("nil context")
|
panic("nil context")
|
||||||
}
|
}
|
||||||
c2 := c.copy()
|
c2 := c.clone()
|
||||||
c2.ctx = ctx
|
c2.ctx = ctx
|
||||||
return c2
|
return c2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ClusterClient) copy() *ClusterClient {
|
func (c *ClusterClient) clone() *ClusterClient {
|
||||||
cp := *c
|
cp := *c
|
||||||
cp.init()
|
cp.init()
|
||||||
return &cp
|
return &cp
|
||||||
|
4
ring.go
4
ring.go
@ -381,12 +381,12 @@ func (c *Ring) WithContext(ctx context.Context) *Ring {
|
|||||||
if ctx == nil {
|
if ctx == nil {
|
||||||
panic("nil context")
|
panic("nil context")
|
||||||
}
|
}
|
||||||
c2 := c.copy()
|
c2 := c.clone()
|
||||||
c2.ctx = ctx
|
c2.ctx = ctx
|
||||||
return c2
|
return c2
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Ring) copy() *Ring {
|
func (c *Ring) clone() *Ring {
|
||||||
cp := *c
|
cp := *c
|
||||||
return &cp
|
return &cp
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user