From ad0eb592d0840161ff2bffeb614b97c8a265a39e Mon Sep 17 00:00:00 2001 From: hovsep Date: Sun, 10 Nov 2024 01:41:19 +0200 Subject: [PATCH] Fix panic in example --- examples/nesting/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/nesting/main.go b/examples/nesting/main.go index 2bd6788..7523fa5 100644 --- a/examples/nesting/main.go +++ b/examples/nesting/main.go @@ -51,14 +51,12 @@ func main() { WithDescription("Simple logger"). WithInputs("in"). WithActivationFunc(func(inputs *port.Collection, outputs *port.Collection) error { - log := func(line string) { - fmt.Printf("LOG: %s", line) + log := func(data any) { + fmt.Printf("LOG: %v", data) } for _, sig := range inputs.ByName("in").AllSignalsOrNil() { - if logLine := sig.PayloadOrNil(); logLine != nil { - log(logLine.(string)) - } + log(sig.PayloadOrNil()) } return nil })