Skip to content

Commit

Permalink
Rename to not shadow imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Sep 30, 2022
1 parent 0cec45a commit cae41cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions sdk/metric/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ type pipeline struct {
// addSync adds the instrumentSync to pipeline p with scope. This method is not
// idempotent. Duplicate calls will result in duplicate additions, it is the
// callers responsibility to ensure this is called with unique values.
func (p *pipeline) addSync(scope instrumentation.Scope, sync instrumentSync) {
func (p *pipeline) addSync(scope instrumentation.Scope, iSync instrumentSync) {
p.Lock()
defer p.Unlock()
if p.aggregations == nil {
p.aggregations = map[instrumentation.Scope][]instrumentSync{
scope: {sync},
scope: {iSync},
}
return
}
p.aggregations[scope] = append(p.aggregations[scope], sync)
p.aggregations[scope] = append(p.aggregations[scope], iSync)
}

// addCallback registers a callback to be run when `produce()` is called.
Expand Down
8 changes: 4 additions & 4 deletions sdk/metric/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ func TestEmptyPipeline(t *testing.T) {
assert.Nil(t, output.Resource)
assert.Len(t, output.ScopeMetrics, 0)

sync := instrumentSync{"name", "desc", unit.Dimensionless, testSumAggregator{}}
iSync := instrumentSync{"name", "desc", unit.Dimensionless, testSumAggregator{}}
assert.NotPanics(t, func() {
pipe.addSync(instrumentation.Scope{}, sync)
pipe.addSync(instrumentation.Scope{}, iSync)
})

require.NotPanics(t, func() {
Expand All @@ -71,9 +71,9 @@ func TestNewPipeline(t *testing.T) {
assert.Equal(t, resource.Empty(), output.Resource)
assert.Len(t, output.ScopeMetrics, 0)

sync := instrumentSync{"name", "desc", unit.Dimensionless, testSumAggregator{}}
iSync := instrumentSync{"name", "desc", unit.Dimensionless, testSumAggregator{}}
assert.NotPanics(t, func() {
pipe.addSync(instrumentation.Scope{}, sync)
pipe.addSync(instrumentation.Scope{}, iSync)
})

require.NotPanics(t, func() {
Expand Down

0 comments on commit cae41cc

Please sign in to comment.