From f32e5e838b21c43e2daf6524bc21cd4434cbb35d Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 13 Dec 2020 22:10:53 +0800 Subject: [PATCH] chore: unsigned value is always non-negative This unsigned value is always non-negative, and hence cannot be less than 0. --- gorush/notification.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gorush/notification.go b/gorush/notification.go index c363726..edd4fb1 100644 --- a/gorush/notification.go +++ b/gorush/notification.go @@ -173,7 +173,7 @@ func CheckMessage(req PushNotification) error { } // ref: https://firebase.google.com/docs/cloud-messaging/http-server-ref - if req.Platform == PlatFormAndroid && req.TimeToLive != nil && (*req.TimeToLive < uint(0) || uint(2419200) < *req.TimeToLive) { + if req.Platform == PlatFormAndroid && req.TimeToLive != nil && *req.TimeToLive > uint(2419200) { msg = "the message's TimeToLive field must be an integer " + "between 0 and 2419200 (4 weeks)" LogAccess.Debug(msg)