minor cleanup of callMetrics
@@ -326,15 +326,14 @@ func callMetrics(metricsAPI *metricsAPI, clock func() time.Time, summaryMetrics
timed = nil
}
harness := newMetricsHarness(metricsAPI.callCount, metricsAPI.callErrorCount, timed, clock)
- return func(c httpsched.Caller) httpsched.Caller {
- if c == nil {
- return nil
- }
- metricsCaller := &callerWithMetrics{
+ return func(c httpsched.Caller) (metricsCaller httpsched.Caller) {
+ if c != nil {
+ metricsCaller = &callerWithMetrics{
Caller: c,
harness: harness,
}
- return metricsCaller
+ }
+ return
}
}
