fix(streams): handle non-string elements in slice source for NewStream
This commit is contained in:
@@ -22,8 +22,13 @@ func NewStream(source any) *Stream {
|
|||||||
}
|
}
|
||||||
case []any:
|
case []any:
|
||||||
s := new(Stream)
|
s := new(Stream)
|
||||||
for _, source := range source {
|
for _, src := range source {
|
||||||
s.producers = append(s.producers, NewProducer(source.(string)))
|
str, ok := src.(string)
|
||||||
|
if !ok {
|
||||||
|
log.Error().Msgf("[stream] NewStream: Expected string, got %v", src)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
s.producers = append(s.producers, NewProducer(str))
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
case map[string]any:
|
case map[string]any:
|
||||||
|
|||||||
Reference in New Issue
Block a user