Skip to content

Commit bfb6600

Browse files
committed
style: fix code formatting and missing whitespaces
1 parent 87efd50 commit bfb6600

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

examples/middleware/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import (
77
"strconv"
88
"time"
99

10-
"github.com/gotd/botapi"
11-
"github.com/gotd/botapi/storage"
1210
"github.com/gotd/log/logzap"
1311
"go.uber.org/zap"
12+
13+
"github.com/gotd/botapi"
14+
"github.com/gotd/botapi/storage"
1415
)
1516

1617
func main() {
@@ -51,7 +52,8 @@ func main() {
5152
bot.Use(botapi.Recover(), botapi.Timeout(time.Minute), botapi.Logging())
5253

5354
log.Info("Starting bot")
55+
5456
if err := bot.Run(ctx); err != nil {
55-
log.Fatal("Run", zap.Error(err))
57+
log.Error("Run", zap.Error(err))
5658
}
5759
}

handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func (b *Bot) route(ctx context.Context, u *Update) {
9292
if b.self != nil {
9393
u.botUsername = b.self.Username
9494
}
95+
9596
c := &Context{Context: ctx, Bot: b, Update: u}
9697

9798
b.router.mu.RLock()
@@ -117,8 +118,10 @@ func (b *Bot) route(ctx context.Context, u *Update) {
117118

118119
return h(c)
119120
}
121+
120122
return nil
121123
}
124+
122125
for i := len(preMws) - 1; i >= 0; i-- {
123126
routingHandler = preMws[i](routingHandler)
124127
}

0 commit comments

Comments
 (0)