Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Improve noop impementation (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanxuehong authored and yurishkuro committed Sep 13, 2019
1 parent 16ba2b6 commit a7454ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type noopSpan struct{}
type noopSpanContext struct{}

var (
defaultNoopSpanContext = noopSpanContext{}
defaultNoopSpan = noopSpan{}
defaultNoopTracer = NoopTracer{}
defaultNoopSpanContext SpanContext = noopSpanContext{}
defaultNoopSpan Span = noopSpan{}
defaultNoopTracer Tracer = NoopTracer{}
)

const (
Expand All @@ -35,7 +35,7 @@ func (n noopSpanContext) ForeachBaggageItem(handler func(k, v string) bool) {}

// noopSpan:
func (n noopSpan) Context() SpanContext { return defaultNoopSpanContext }
func (n noopSpan) SetBaggageItem(key, val string) Span { return defaultNoopSpan }
func (n noopSpan) SetBaggageItem(key, val string) Span { return n }
func (n noopSpan) BaggageItem(key string) string { return emptyString }
func (n noopSpan) SetTag(key string, value interface{}) Span { return n }
func (n noopSpan) LogFields(fields ...log.Field) {}
Expand Down

0 comments on commit a7454ce

Please sign in to comment.