🎨 Little code format

This commit is contained in:
Maxim Lebedev 2018-01-25 17:26:10 +05:00
parent 4dfb50b346
commit 97759d7cbf
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
2 changed files with 5 additions and 6 deletions

View File

@ -42,9 +42,7 @@ func getUpdatesChannel() tg.UpdatesChannel {
) )
log.Ln("Creating new webhook...") log.Ln("Creating new webhook...")
webhook := tg.NewWebhook( webhook := tg.NewWebhook(fmt.Sprint(set, listen, bot.AccessToken), nil)
fmt.Sprint(set, listen, bot.AccessToken), nil,
)
webhook.MaxConnections = 40 webhook.MaxConnections = 40
webhook.AllowedUpdates = allowedUpdates webhook.AllowedUpdates = allowedUpdates

View File

@ -14,6 +14,10 @@ func main() {
var err error var err error
go dbInit() go dbInit()
defer func() {
err = db.Close()
errCheck(err)
}()
log.Ln("Initializing new bot via checking access_token...") log.Ln("Initializing new bot via checking access_token...")
bot, err = tg.NewBot(cfg.UString("telegram.token")) bot, err = tg.NewBot(cfg.UString("telegram.token"))
@ -35,7 +39,4 @@ func main() {
log.D(update) log.D(update)
} }
} }
err = db.Close()
errCheck(err)
} }