Этот коммит содержится в:
Chris
2018-01-30 17:23:00 -06:00
коммит произвёл Corey Hulen
родитель ac2e42a480
Коммит 0c8968fb8d
62 изменённых файлов: 430 добавлений и 1235 удалений

Просмотреть файл

@@ -47,12 +47,8 @@ type PushNotification struct {
}
func (me *PushNotification) ToJson() string {
b, err := json.Marshal(me)
if err != nil {
return ""
} else {
return string(b)
}
b, _ := json.Marshal(me)
return string(b)
}
func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) {
@@ -66,12 +62,7 @@ func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) {
}
func PushNotificationFromJson(data io.Reader) *PushNotification {
decoder := json.NewDecoder(data)
var me PushNotification
err := decoder.Decode(&me)
if err == nil {
return &me
} else {
return nil
}
var me *PushNotification
json.NewDecoder(data).Decode(&me)
return me
}