docs: fix Send migration guide — restore old error-only signature in before/after example

This commit is contained in:
Dmitrii Balabanov 2026-03-30 13:09:19 +03:00
parent b811d8cd42
commit ae96f11821
2 changed files with 6 additions and 6 deletions

View file

@ -253,10 +253,10 @@ func (c *TelegramChannel) Stop(ctx context.Context) error {
```go
// Old code: returned only error
func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]string, error) {
if !c.running { return nil, fmt.Errorf("not running") }
func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) error {
if !c.running { return fmt.Errorf("not running") }
// ...
if err != nil { return nil, err }
if err != nil { return err }
}
// New code: return delivered message IDs plus sentinel errors

View file

@ -253,10 +253,10 @@ func (c *TelegramChannel) Stop(ctx context.Context) error {
```go
// 旧代码:只返回 error
func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]string, error) {
if !c.running { return nil, fmt.Errorf("not running") }
func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) error {
if !c.running { return fmt.Errorf("not running") }
// ...
if err != nil { return nil, err }
if err != nil { return err }
}
// 新代码:返回投递后的消息 ID以及供 Manager 判断重试策略的哨兵错误