mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-12 10:04:29 +02:00
Lint
This commit is contained in:
parent
559606c419
commit
ec6512f656
@ -20,6 +20,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"go.opentelemetry.io/otel/api/oterror"
|
"go.opentelemetry.io/otel/api/oterror"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
"go.opentelemetry.io/otel/api/kv"
|
"go.opentelemetry.io/otel/api/kv"
|
||||||
"go.opentelemetry.io/otel/api/metric"
|
"go.opentelemetry.io/otel/api/metric"
|
||||||
|
"go.opentelemetry.io/otel/api/oterror"
|
||||||
"go.opentelemetry.io/otel/api/unit"
|
"go.opentelemetry.io/otel/api/unit"
|
||||||
mockTest "go.opentelemetry.io/otel/internal/metric"
|
mockTest "go.opentelemetry.io/otel/internal/metric"
|
||||||
|
|
||||||
@ -391,7 +392,7 @@ func TestWrappedInstrumentError(t *testing.T) {
|
|||||||
|
|
||||||
valuerecorder, err := meter.NewInt64ValueRecorder("test.valuerecorder")
|
valuerecorder, err := meter.NewInt64ValueRecorder("test.valuerecorder")
|
||||||
|
|
||||||
require.Equal(t, err, metric.ErrSDKReturnedNilImpl)
|
require.Equal(t, err, oterror.ErrSDKReturnedNilImpl)
|
||||||
require.NotNil(t, valuerecorder.SyncImpl())
|
require.NotNil(t, valuerecorder.SyncImpl())
|
||||||
|
|
||||||
observer, err := meter.NewInt64ValueObserver("test.observer", func(_ context.Context, result metric.Int64ObserverResult) {})
|
observer, err := meter.NewInt64ValueObserver("test.observer", func(_ context.Context, result metric.Int64ObserverResult) {})
|
||||||
|
@ -110,7 +110,7 @@ func (h syncBoundInstrument) Unbind() {
|
|||||||
func checkNewAsync(instrument AsyncImpl, err error) (asyncInstrument, error) {
|
func checkNewAsync(instrument AsyncImpl, err error) (asyncInstrument, error) {
|
||||||
if instrument == nil {
|
if instrument == nil {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = oterror.SDKReturnedNilImpl
|
err = oterror.ErrSDKReturnedNilImpl
|
||||||
}
|
}
|
||||||
instrument = NoopAsync{}
|
instrument = NoopAsync{}
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ func checkNewAsync(instrument AsyncImpl, err error) (asyncInstrument, error) {
|
|||||||
func checkNewSync(instrument SyncImpl, err error) (syncInstrument, error) {
|
func checkNewSync(instrument SyncImpl, err error) (syncInstrument, error) {
|
||||||
if instrument == nil {
|
if instrument == nil {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = oterror.SDKReturnedNilImpl
|
err = oterror.ErrSDKReturnedNilImpl
|
||||||
}
|
}
|
||||||
// Note: an alternate behavior would be to synthesize a new name
|
// Note: an alternate behavior would be to synthesize a new name
|
||||||
// or group all duplicately-named instruments of a certain type
|
// or group all duplicately-named instruments of a certain type
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
* The unified error handling interface is used for any error that
|
* The unified error handling interface is used for any error that
|
||||||
* OpenTelemetry component are not able to remediate on their own, instead
|
* OpenTelemetry component are not able to remediate on their own, instead
|
||||||
* handeling them in a uniform and user-defined way.
|
* handling them in a uniform and user-defined way.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package oterror
|
package oterror
|
||||||
|
@ -17,6 +17,6 @@ package oterror
|
|||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// SDKReturnedNilImpl is returned when a new `MeterImpl` returns nil.
|
// ErrSDKReturnedNilImpl is returned when a new `MeterImpl` returns nil.
|
||||||
SDKReturnedNilImpl = errors.New("SDK returned a nil implementation")
|
ErrSDKReturnedNilImpl = errors.New("SDK returned a nil implementation")
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user