aboutsummaryrefslogtreecommitdiff
path: root/api/telegram
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-08 02:52:16 +0700
committerShulhan <ms@kilabit.info>2024-03-09 01:10:24 +0700
commit29343294a596fd74f6f9cb917c8aac74ccb78094 (patch)
treee9286ed53041b973cb6d767325034f30e504e1f5 /api/telegram
parent4e35c509a41cecb207bf6f52e7c9a529fa9f71fb (diff)
downloadpakakeh.go-29343294a596fd74f6f9cb917c8aac74ccb78094.tar.xz
lib/http: refactoring NewServer and NewClient
The NewServer and NewClient now accept non-pointer options, so the caller unable to modify the options once the server or client has been created.
Diffstat (limited to 'api/telegram')
-rw-r--r--api/telegram/bot/bot.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/telegram/bot/bot.go b/api/telegram/bot/bot.go
index c87546b3..2ac3f0a0 100644
--- a/api/telegram/bot/bot.go
+++ b/api/telegram/bot/bot.go
@@ -110,7 +110,7 @@ func New(opts Options) (bot *Bot, err error) {
return nil, fmt.Errorf("bot.New: %w", err)
}
- clientOpts := &http.ClientOptions{
+ var clientOpts = http.ClientOptions{
ServerURL: defURL + opts.Token + `/`,
}
bot = &Bot{
@@ -365,7 +365,7 @@ func (bot *Bot) startWebhook() (err error) {
// createServer start the HTTP server for receiving Update.
func (bot *Bot) createServer() (err error) {
- serverOpts := &http.ServerOptions{
+ var serverOpts = http.ServerOptions{
Address: bot.opts.Webhook.ListenAddress,
}