Skip to content

Commit

Permalink
Merge pull request #2272 from Shopify/dnwe/any
Browse files Browse the repository at this point in the history
chore: rename `any` func to avoid identifier
  • Loading branch information
dnwe committed Jul 19, 2022
2 parents 7a92423 + 10b760c commit 6228349
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (client *client) Broker(brokerID int32) (*Broker, error) {

func (client *client) InitProducerID() (*InitProducerIDResponse, error) {
brokerErrors := make([]error, 0)
for broker := client.any(); broker != nil; broker = client.any() {
for broker := client.anyBroker(); broker != nil; broker = client.anyBroker() {
var response *InitProducerIDResponse
req := &InitProducerIDRequest{}

Expand Down Expand Up @@ -691,7 +691,7 @@ func (client *client) resurrectDeadBrokers() {
client.deadSeeds = nil
}

func (client *client) any() *Broker {
func (client *client) anyBroker() *Broker {
client.lock.RLock()
defer client.lock.RUnlock()

Expand Down Expand Up @@ -895,9 +895,9 @@ func (client *client) tryRefreshMetadata(topics []string, attemptsRemaining int,
return err
}

broker := client.any()
broker := client.anyBroker()
brokerErrors := make([]error, 0)
for ; broker != nil && !pastDeadline(0); broker = client.any() {
for ; broker != nil && !pastDeadline(0); broker = client.anyBroker() {
allowAutoTopicCreation := client.conf.Metadata.AllowAutoTopicCreation
if len(topics) > 0 {
DebugLogger.Printf("client/metadata fetching metadata for %v from broker %s\n", topics, broker.addr)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ func (client *client) getConsumerMetadata(consumerGroup string, attemptsRemainin
}

brokerErrors := make([]error, 0)
for broker := client.any(); broker != nil; broker = client.any() {
for broker := client.anyBroker(); broker != nil; broker = client.anyBroker() {
DebugLogger.Printf("client/coordinator requesting coordinator for consumergroup %s from %s\n", consumerGroup, broker.Addr())

request := new(FindCoordinatorRequest)
Expand Down

0 comments on commit 6228349

Please sign in to comment.