From fad23ee62c0cd0f98ddcbfc99e92de63d9f3245c Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 30 May 2024 11:27:07 -0700 Subject: [PATCH] Remove zeroInstrumentKind (#5433) It is a duplicate of `instrumentKindUndefined`. Use `instrumentKindUndefined` instead. --- sdk/metric/instrument.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sdk/metric/instrument.go b/sdk/metric/instrument.go index bbf56086738..b52a330b3bc 100644 --- a/sdk/metric/instrument.go +++ b/sdk/metric/instrument.go @@ -18,10 +18,7 @@ import ( "go.opentelemetry.io/otel/sdk/metric/internal/aggregate" ) -var ( - zeroInstrumentKind InstrumentKind - zeroScope instrumentation.Scope -) +var zeroScope instrumentation.Scope // InstrumentKind is the identifier of a group of instruments that all // performing the same function. @@ -81,7 +78,7 @@ type Instrument struct { func (i Instrument) IsEmpty() bool { return i.Name == "" && i.Description == "" && - i.Kind == zeroInstrumentKind && + i.Kind == instrumentKindUndefined && i.Unit == "" && i.Scope == zeroScope } @@ -112,7 +109,7 @@ func (i Instrument) matchesDescription(other Instrument) bool { // matchesKind returns true if the Kind of i is its zero-value or it equals the // Kind of other, otherwise false. func (i Instrument) matchesKind(other Instrument) bool { - return i.Kind == zeroInstrumentKind || i.Kind == other.Kind + return i.Kind == instrumentKindUndefined || i.Kind == other.Kind } // matchesUnit returns true if the Unit of i is its zero-value or it equals the