=== RUN TestSetWebhookWithoutCert
2020/02/29 22:51:04 setWebhook resp: {"ok":true,"result":true,"description":"Webhook is already deleted"}
--- FAIL: TestSetWebhookWithoutCert (2.83s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5d6e4a]
goroutine 6 [running]:
testing.tRunner.func1(0xc0000e4100)
/snap/go/5364/src/testing/testing.go:874 +0x3a3
panic(0x71b060, 0x9fd7f0)
/snap/go/5364/src/runtime/panic.go:679 +0x1b2
net/url.(*URL).String(0x0, 0xc000001980, 0x300000002)
/snap/go/5364/src/net/url/url.go:775 +0x4a
github.com/go-telegram-bot-api/telegram-bot-api.(*BotAPI).SetWebhook(0xc0000ea000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/user/GolandProjects/telegram-bot-api/bot.go:454 +0x3c8
github.com/go-telegram-bot-api/telegram-bot-api_test.TestSetWebhookWithoutCert(0xc0000e4100)
/home/user/GolandProjects/telegram-bot-api/bot_test.go:491 +0x15d
testing.tRunner(0xc0000e4100, 0x799998)
/snap/go/5364/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
/snap/go/5364/src/testing/testing.go:960 +0x350
Process finished with exit code 1
Here's an error is ignored
telegram-bot-api/helpers.go
Lines 394 to 400 in aa124ef
so when you pass an url like
"https://example.com" + bot.Tokenhere (and I think it's easy to do such mistake)telegram-bot-api/bot_test.go
Line 490 in aa124ef
the test (and bot of course) fails with this