Closed chakrit closed 9 years ago
Also you can't take the address of int
literals directly.
All of the following lines fails to compile in go1.4:
var x *int = 4 // cannot use 4 (type int) as type *int in assignment
x = &5 // cannot take the address of 5
So direct assignment as example in the docs is now impossible. I have to put it in a temporary variable first and take that var's address which is kinda cumbersome actually.
@chakrit This isn't specific to Go 1.4.
It is a breaking change in timehop/apns. Sorry about that :frowning:
The reason badge is now a pointer is because badge=0 and not sending badge have different behaviours on Apple's side. See #15.
The docs/example do need to be updated.
Luckily I think the direct assignment case is going to be rare by the nature of the badge. Anyone want to volunteer to do the docs? Otherwise, assign me and I'll do it "sometime".
The example was updated in 4274e69b3a28afa3f7627f58f08619729bf82278 but the README still needs updating.
Thanks for clarifying.
I can help over the weekends if I dont forget it by then :p
This line: https://github.com/timehop/apns/blob/master/notification.go#L50
Since it is a
*int
you can no longer assignint
to it directly. This is probably due to the pointer handling changes in the recently released go1.4.I think the docs needs updating to reflect this.