atc0005 / notes

Various notes, quick references and topics I want to explore further
MIT License
0 stars 0 forks source link

Go | Pointers are used to avoid translating nulls (in JSON) to empty strings #45

Open atc0005 opened 3 years ago

atc0005 commented 3 years ago

Post here:

https://github.com/goinaction/code/issues/31#issuecomment-850679697

I just had exactly the same question in golang general slack and the answer I received is the follows:

Pointers are used to avoid translating nulls (in JSON) to empty strings ("the billion-dollar mistake").

Examples: https://play.golang.org/p/TQ6GGBKK-gA vs. https://play.golang.org/p/ibhTYaKm6Vf