Skip to content

Commit

Permalink
Add a minor comment about data types for future safety
Browse files Browse the repository at this point in the history
  • Loading branch information
KristianLyng committed Sep 27, 2024
1 parent 99623a3 commit f76c5fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions transformer/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func (replace *Replace) Transform(c *skogul.Container) error {
delete(c.Metrics[mi].Metadata, replace.Destination)
continue
}
// FIXME: This should be a type cast to allow working with
// both text strings (as per now) and []byte strings.
// Similar to what is done in the ban transformer.
str, ok := c.Metrics[mi].Metadata[replace.Source].(string)
if !ok {
// FIXME: What to do? It's tempting to copy the
Expand Down

0 comments on commit f76c5fa

Please sign in to comment.