Skip to content

Commit

Permalink
Merge pull request #32 from opentracing/foreach-baggage
Browse files Browse the repository at this point in the history
Implement ForeachBaggageItem
  • Loading branch information
yurishkuro committed Jul 1, 2016
2 parents 1bf31ca + 9d2afdf commit 1050f2f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions span.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ func (s *spanImpl) BaggageItem(restrictedKey string) string {
return s.raw.Baggage[canonicalKey]
}

func (s *spanImpl) ForeachBaggageItem(handler func(k, v string) bool) {
s.Lock()
defer s.Unlock()
for k, v := range s.raw.Baggage {
if !handler(k, v) {
break
}
}
}

func (s *spanImpl) Tracer() opentracing.Tracer {
return s.tracer
}
Expand Down

0 comments on commit 1050f2f

Please sign in to comment.