diff options
| author | Shulhan <ms@kilabit.info> | 2025-07-14 23:41:06 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-07-14 23:44:57 +0700 |
| commit | 7f0664344c75f502e7e8f1baf1e394bcbb5ca1ad (patch) | |
| tree | f1dfefe17a835f0e00dbe96d742195ef61337568 /cmd/kamusku-telegram-bot/main.go | |
| parent | 6754efaefeec3290a690339df563890b85775458 (diff) | |
| download | kamusku-7f0664344c75f502e7e8f1baf1e394bcbb5ca1ad.tar.xz | |
all: replace golangci-lint with internal linter
The internal/cmd/gocheck use the go static analysis [Analyzer] that are
not included in the default go vet.
By using gocheck we found un-alignment and shadowing,
* client.go:18:13: struct with 24 pointer bytes could be 16
* dictionary.go:23:17: struct with 32 pointer bytes could be 16
* client_test.go:18:13: struct with 56 pointer bytes could be 48
* client_test.go:62:13: struct with 56 pointer bytes could be 48
* cmd/kamusku-telegram-bot/main.go:31:3: declaration of "err" shadows
declaration at line 25
* kamusku_test.go:49:3: declaration of "err" shadows declaration at
line 38
[Analyzer]: https://pkg.go.dev/golang.org/x/tools/go/analysis#hdr-Analyzer
Diffstat (limited to 'cmd/kamusku-telegram-bot/main.go')
| -rw-r--r-- | cmd/kamusku-telegram-bot/main.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/kamusku-telegram-bot/main.go b/cmd/kamusku-telegram-bot/main.go index 3dc0828..8704507 100644 --- a/cmd/kamusku-telegram-bot/main.go +++ b/cmd/kamusku-telegram-bot/main.go @@ -19,18 +19,20 @@ func main() { var ( tgToken = `1121465148:AAE6Yf0YevYcyC--eCZyMqSpVia-pK5iFM4` tgWebhook = `https://kamusku.kilabit.info/telegram/webhook` + tgbot *kamusku.TelegramBot + err error ) // Use the token and Webhook URL from environment variables. - tgbot, err := kamusku.NewTelegramBot(tgToken, tgWebhook) + tgbot, err = kamusku.NewTelegramBot(tgToken, tgWebhook) if err != nil { log.Fatal(err) } go func() { - err := tgbot.Start() - if err != nil { - log.Println(err) + var errStart = tgbot.Start() + if errStart != nil { + log.Println(errStart) } }() |
