From e5d1a96e4b9246e24402c9e242eb99096d158c09 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Sun, 5 Jan 2020 19:53:23 +0100 Subject: [PATCH] fix score overflow --- task2-backend/lib/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/task2-backend/lib/api.go b/task2-backend/lib/api.go index beca51b..601fea5 100644 --- a/task2-backend/lib/api.go +++ b/task2-backend/lib/api.go @@ -82,7 +82,7 @@ func (a *Api) checkScore(ctx *routing.Context) (err error) { type Score struct { Key string `json:"key"` - Score int `json:"score"` + Score int64 `json:"score"` } type Response struct { @@ -133,7 +133,7 @@ func (a *Api) checkScore(ctx *routing.Context) (err error) { resp := &Response{Top: zz} - if int(zz[0].Score) > score.Score { + if int64(zz[0].Score) > score.Score { resp.Msg = []string{ `ух, хорошая игра, но нужно стараться еще!`, }