diff --git a/src/main.go b/src/main.go index b003e90..ac990c4 100644 --- a/src/main.go +++ b/src/main.go @@ -15,12 +15,12 @@ type Options struct { } var ( - config *TransportConfig - orm *Orm - logger *logging.Logger - options Options - parser = flags.NewParser(&options, flags.Default) - rx = regexp.MustCompile(`/+$`) + config *TransportConfig + orm *Orm + logger *logging.Logger + options Options + parser = flags.NewParser(&options, flags.Default) + rx = regexp.MustCompile(`/+$`) currency = map[string]string{ "rub": "₽", "uah": "₴", diff --git a/src/routing.go b/src/routing.go index 2258a08..8c11a00 100644 --- a/src/routing.go +++ b/src/routing.go @@ -510,14 +510,14 @@ func mgWebhookHandler(c *gin.Context) { ) } - if msg.Data.Product.Img != "" { + if msg.Data.Product.Img != "" { mb = fmt.Sprintf("\n%s", msg.Data.Product.Img) } } else if msg.Data.Type == v1.MsgTypeOrder { mb = "**Заказ" - if msg.Data.Order.Number != ""{ + if msg.Data.Order.Number != "" { mb += " " + msg.Data.Order.Number } @@ -527,8 +527,8 @@ func mgWebhookHandler(c *gin.Context) { mb += "**\n" if len(msg.Data.Order.Items) > 0 { - for _, v := range msg.Data.Order.Items { - mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)]) + for _, v := range msg.Data.Order.Items { + mb += fmt.Sprintf("%s %v x %v %s\n", v.Name, v.Quantity.Value, v.Price.Value, currency[strings.ToLower(v.Price.Currency)]) } }