Skip to content

Commit e169788

Browse files
committed
CLENAUP/MINOR: cluster: fix pointer
in for loop value of &v is changeg during iteration. although we exit imidiatelly, it is good practice to use direct indexed location
1 parent fc6b183 commit e169788

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configuration/cluster_sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ func (c *ClusterSync) issueJoinRequest(url, port, basePath string, nodesPath str
249249
return fmt.Errorf("no users configured in %v userlist in conf", c.cfg.HAProxy.Userlist)
250250
}
251251
var user *types.User
252-
for _, u := range users {
252+
for index, u := range users {
253253
if u.IsInsecure {
254-
user = &u
254+
user = &users[index]
255255
break
256256
}
257257
}

0 commit comments

Comments
 (0)