Skip to content

Commit

Permalink
Fix panic in example
Browse files Browse the repository at this point in the history
  • Loading branch information
hovsep committed Nov 10, 2024
1 parent d89e9b6 commit ad0eb59
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/nesting/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit ad0eb59

Please sign in to comment.