Skip to content

Commit 6dc4f08

Browse files
committed
fix retain publish with options
1 parent cc7ec56 commit 6dc4f08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

v2/emitter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ func (c *Client) PublishWithTTL(key string, channel string, payload interface{},
259259

260260
// PublishWithRetain publishes a message with a retain flag set to true
261261
func (c *Client) PublishWithRetain(key string, channel string, payload interface{}, options ...Option) error {
262-
return c.Publish(key, channel, payload, WithRetain())
262+
options = append(options, WithRetain())
263+
return c.Publish(key, channel, payload, options...)
263264
}
264265

265266
// PublishWithLink publishes a message with a specified link name instead of a channel key.

0 commit comments

Comments
 (0)