unnamed return (#8170)
Этот коммит содержится в:
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user