Skip to content

Commit

Permalink
fix Subscribe bug (#346)
Browse files Browse the repository at this point in the history
Co-authored-by: guyinyou <[email protected]>
  • Loading branch information
guyinyou and guyinyou committed Jan 17, 2023
1 parent aa3e9fd commit 83493ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions golang/simple_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ var NewSimpleConsumer = func(config *Config, opts ...SimpleConsumerOption) (Simp
awaitDuration: scOpts.awaitDuration,
subscriptionExpressions: scOpts.subscriptionExpressions,
}
if sc.subscriptionExpressions == nil {
sc.subscriptionExpressions = make(map[string]*FilterExpression)
}
sc.cli.initTopics = make([]string, 0)
for topic, _ := range scOpts.subscriptionExpressions {
sc.cli.initTopics = append(sc.cli.initTopics, topic)
Expand Down

0 comments on commit 83493ea

Please sign in to comment.