Skip to content

Commit f0cfca8

Browse files
committed
fix bug with Create() on multi-balancer + fix linter issue
1 parent d7d46e3 commit f0cfca8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Improved error messages
33
* Defended `cluster.balancer` with `sync.RWMutex` on `cluster.Insert`, `cluster.Update`, `cluster.Remove` and `cluster.Get`
44
* Excluded `Close` and `Park` methods from `conn.Conn` interface
5+
* Fixed bug with `Create()` on multi-balancer
56

67
## 3.13.0
78
* Refactored `Connection` interface

internal/balancer/multi/multi.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ type multi struct {
2424
}
2525

2626
func (m *multi) Create() balancer.Balancer {
27-
bb := m.balancer
28-
for i := range bb {
29-
bb[i] = bb[i].(balancer.Creator).Create()
27+
bb := make([]balancer.Balancer, len(m.balancer))
28+
for i, b := range m.balancer {
29+
bb[i] = b.(balancer.Creator).Create()
3030
}
3131
return &multi{
3232
balancer: bb,

log/scripting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
)
88

99
func Scripting(log Logger, details trace.Details) (t trace.Scripting) {
10+
// nolint:nestif
1011
if details&trace.ScriptingEvents != 0 {
1112
log = log.WithName(`scripting`)
1213
t.OnExecute = func(info trace.ExecuteStartInfo) func(trace.ExecuteDoneInfo) {

0 commit comments

Comments
 (0)