From 0912afa68a41ede2a877281816d4d2e84c583b6c Mon Sep 17 00:00:00 2001 From: potassium Date: Fri, 27 Dec 2024 00:31:19 +0300 Subject: [PATCH] cleanup --- market.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/market.go b/market.go index 3d7fccb..54111d5 100644 --- a/market.go +++ b/market.go @@ -98,13 +98,7 @@ func GetImage(link string) (image.Image, error) { } defer resp.Body.Close() -if resp == nil { - log.Fatal("pizdec") -} img, _, err := image.Decode(resp.Body) - if img == nil { - log.Fatal("img is nil") - } if err != nil { return nil, err } @@ -115,7 +109,7 @@ func HandleCommand(update tg.Update, bot *tg.BotAPI) { maxCost := 5 var err error for i := 0; i <= maxCost; i++ { -buf := new(bytes.Buffer) + buf := new(bytes.Buffer) var img = imageutils.Concat( Must(GetImage(fmt.Sprintf(LinkFormat, takeOne(ShuffledCardPool)))), @@ -123,14 +117,7 @@ buf := new(bytes.Buffer) takeOne(ShuffledCardPool)))), imageutils.Right, ) - if img == nil { - log.Fatal("pizdec") - } - - err = png.Encode( - buf, - img, - ) + err = png.Encode(buf, img) if err != nil { log.Println("error on decode:", err) }