Skip to content

Commit

Permalink
Minor format fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ssingudasu committed Feb 6, 2024
1 parent 492ada5 commit ca396d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/admin/zkclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,23 +305,23 @@ func (c *ZKAdminClient) GetControllerID(
var dataMap map[string]interface{}
data, _, err := c.zkClient.Get(ctx, zkControllerPath)
if err != nil {
return -1, fmt.Errorf("Error getting zookeeper path: %s, error: %+v",
return -1, fmt.Errorf("Error getting zookeeper path %s: %+v",
zkControllerPath,
err,
)
}

err = json.Unmarshal(data, &dataMap)
if err != nil {
return -1, fmt.Errorf("Error unmarshaling zookeeper response", err)
return -1, fmt.Errorf("Error unmarshaling zookeeper response: %+v", err)
}

// even if interface data is of type int, it is recognized as float64
if brokerID, ok := dataMap["brokerid"].(float64); ok {
return int(brokerID), nil
}

return -1, fmt.Errorf("Broker ID not found in zookeeper controller path: %s, error: %+v",
return -1, fmt.Errorf("Broker ID not found in zookeeper controller path %s: %+v",
zkControllerPath,
err,
)
Expand Down

0 comments on commit ca396d7

Please sign in to comment.