Skip to content

Commit 916bd0e

Browse files
committed
fixing vet
1 parent b73b5d2 commit 916bd0e

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

internal/xds/clients/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@ type MetricsReporter interface {
112112

113113
// RegisterAsyncReporter registers a reporter to produce metric values for
114114
// the set of metrics supported by the client. See the metrics sub-package
115-
// for the specific client
116-
// (e.g. internal/xds/clients/xdsclient/metrics/metrics.go) for the list of
117-
// supported metrics. The returned function must be called when the metrics
118-
// are no longer needed, which will remove the reporter.
115+
// for the specific client (e.g. internal/xds/clients/xdsclient/metrics/metrics.go)
116+
// for the list of supported metrics. The returned function must be called
117+
// when the metrics are no longer needed, which will remove the reporter.
119118
//
120119
// Once the returned cancel function is called, the Report method on the
121120
// registered reporter is guaranteed not to be called again.

internal/xds/clients/xdsclient/ads_stream.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,9 +721,8 @@ func (fc *adsFlowControl) wait() bool {
721721
return fc.stopped
722722
}
723723

724-
725724
func (s *adsStreamImpl) isStreamEstablished() bool {
726-
s.mu.Lock()
727-
defer s.mu.Unlock()
728-
return s.streamEstablished
725+
s.mu.Lock()
726+
defer s.mu.Unlock()
727+
return s.streamEstablished
729728
}

internal/xds/clients/xdsclient/xdsclient.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,13 @@ func (c *XDSClient) reportConnectedState(rec clients.AsyncMetricsRecorder) {
484484

485485
// reportResourceStats handles the "grpc.xds_client.resources" metric.
486486
func (c *XDSClient) reportResourceStats(rec clients.AsyncMetricsRecorder) {
487-
reportForAuthority := func(a *authority) {
488-
stats := a.resourceStats()
487+
reportForAuthority := func(auth *authority) {
488+
stats := auth.resourceStats()
489489
for typeURL, stateCounts := range stats {
490490
for cacheState, count := range stateCounts {
491491
if count > 0 {
492492
rec.ReportMetric(&metrics.XDSClientResourceStats{
493-
Authority: a.name,
493+
Authority: auth.name,
494494
ResourceType: typeURL,
495495
CacheState: cacheState,
496496
Count: int64(count),
@@ -499,12 +499,11 @@ func (c *XDSClient) reportResourceStats(rec clients.AsyncMetricsRecorder) {
499499
}
500500
}
501501
}
502-
503502
if c.topLevelAuthority != nil {
504503
reportForAuthority(c.topLevelAuthority)
505504
}
506-
for _, a := range c.authorities {
507-
reportForAuthority(a)
505+
for _, auth := range c.authorities {
506+
reportForAuthority(auth)
508507
}
509508
}
510509

0 commit comments

Comments
 (0)