From d0990b5f1e054374a17c3860cb16908ddd2170fd Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+unamed@users.noreply.github.com> Date: Sat, 7 Aug 2021 04:29:44 +0000 Subject: [PATCH] Fix ip resolve --- telegram/common.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegram/common.go b/telegram/common.go index 127bd59..b8edab5 100644 --- a/telegram/common.go +++ b/telegram/common.go @@ -6,8 +6,10 @@ package telegram import ( + "net" "reflect" "runtime" + "strconv" "github.com/pkg/errors" "github.com/xelaj/errs" @@ -119,7 +121,7 @@ func NewClient(c ClientConfig) (*Client, error) { //nolint: gocritic arg is not continue } - dcList[int(dc.ID)] = dc.IpAddress + ":" + strconv.Itoa(int(dc.Port)) + dcList[int(dc.ID)] = net.JoinHostPort(dc.IpAddress, strconv.Itoa(int(dc.Port))) } client.SetDCList(dcList) return client, nil