1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-02 08:52:21 +02:00

check interface implement (#37)

This commit is contained in:
thinkerou 2019-07-02 03:11:24 +08:00 committed by rghetia
parent a606839692
commit 861e3e8776
3 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,8 @@ type scopeIdent struct {
id core.ScopeID
}
var _ Scope = (*scopeIdent)(nil)
type scopeKeyType struct{}
var (

View File

@ -31,6 +31,8 @@ type Recorder struct {
core.ScopeID
}
var _ Interface = (*Recorder)(nil)
func With(scope scope.Scope) Recorder {
return Recorder{scope.ScopeID()}
}

View File

@ -21,12 +21,16 @@ import (
"github.com/open-telemetry/opentelemetry-go/api/core"
"github.com/open-telemetry/opentelemetry-go/api/event"
"github.com/open-telemetry/opentelemetry-go/api/scope"
"github.com/open-telemetry/opentelemetry-go/api/stats"
)
type noopSpan struct {
}
var _ Span = (*noopSpan)(nil)
var _ stats.Interface = (*noopSpan)(nil)
var _ scope.Mutable = (*noopSpan)(nil)
// SpancContext returns an invalid span context.
func (sp *noopSpan) SpanContext() core.SpanContext {