Skip to content

Commit

Permalink
Update tag_processor_plugin/tag_processor_plugin.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
FreiPaul and coderabbitai[bot] authored Feb 13, 2025
1 parent 4a0c2d5 commit 37cad71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tag_processor_plugin/tag_processor_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,16 @@ func (p *TagProcessor) constructFinalMessage(msg *service.Message) (*service.Mes
}
if exposeAll {
allMeta := make(map[string]string)
_ = msg.MetaWalkMut(func(key string, value any) error {
if err := msg.MetaWalkMut(func(key string, value any) error {
if str, ok := value.(string); ok {
allMeta[key] = str
} else {
allMeta[key] = fmt.Sprintf("%v", value)
}
return nil
})
}); err != nil {
return nil, fmt.Errorf("failed to collect all metadata: %v", err)
}
finalPayload["meta"] = allMeta
} else if len(filteredMeta) > 0 {
finalPayload["meta"] = filteredMeta
Expand Down

0 comments on commit 37cad71

Please sign in to comment.