From 841d2a5885b37fc25fe77e72dca3b0f6bac945b2 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Wed, 3 Mar 2021 16:26:26 +0000 Subject: [PATCH] Rename local var new to not collide with builtin (#1610) * Rename local var new to not collide with builtin * Add missed var rename --- sdk/trace/provider.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/trace/provider.go b/sdk/trace/provider.go index 64012c866..053b40560 100644 --- a/sdk/trace/provider.go +++ b/sdk/trace/provider.go @@ -130,17 +130,17 @@ func (p *TracerProvider) RegisterSpanProcessor(s SpanProcessor) { func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) { p.mu.Lock() defer p.mu.Unlock() - new := spanProcessorStates{} + spss := spanProcessorStates{} old, ok := p.spanProcessors.Load().(spanProcessorStates) if !ok || len(old) == 0 { return } - new = append(new, old...) + spss = append(spss, old...) // stop the span processor if it is started and remove it from the list var stopOnce *spanProcessorState var idx int - for i, sps := range new { + for i, sps := range spss { if sps.sp == s { stopOnce = sps idx = i @@ -153,13 +153,13 @@ func (p *TracerProvider) UnregisterSpanProcessor(s SpanProcessor) { } }) } - if len(new) > 1 { - copy(new[idx:], new[idx+1:]) + if len(spss) > 1 { + copy(spss[idx:], spss[idx+1:]) } - new[len(new)-1] = nil - new = new[:len(new)-1] + spss[len(spss)-1] = nil + spss = spss[:len(spss)-1] - p.spanProcessors.Store(new) + p.spanProcessors.Store(spss) } // ApplyConfig changes the configuration of the provider.