Skip to content

Commit

Permalink
metadata update
Browse files Browse the repository at this point in the history
  • Loading branch information
pherzheyu authored May 17, 2022
1 parent 5e12eb3 commit bda51ce
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions filter/otel/trace/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@ func (s *metadataSupplier) Get(key string) string {
if s.metadata == nil {
return ""
}
item, ok := s.metadata[key]
item, ok := s.metadata[key].([]string)
if !ok {
return ""
}
value, ok := item.([]string)
if !ok {
return ""
}
if len(value) == 0 {
if len(item) == 0 {
return ""
}
return value[0]
return item[0]
}

func (s *metadataSupplier) Set(key string, value string) {
Expand Down

0 comments on commit bda51ce

Please sign in to comment.