From f76c5fa39d0ff7198bf8ae36d804d0ba50d1fc1f Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 27 Sep 2024 15:14:08 +0200 Subject: [PATCH] Add a minor comment about data types for future safety --- transformer/edit.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/transformer/edit.go b/transformer/edit.go index 200b607f..0ce9695a 100644 --- a/transformer/edit.go +++ b/transformer/edit.go @@ -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