guregu / null

reasonable handling of nullable values
BSD 2-Clause "Simplified" License
1.86k stars 238 forks source link

feat: ValueOrZero works for nil values #38

Closed arthurgustin closed 4 years ago

arthurgustin commented 6 years ago

Hi, I have a use-case where I use *null.Int in my structures because I want to hide them during json Marshalling, what do you think ?

guregu commented 4 years ago

Clever solution but if you're going to do this I think you might as well just use *int instead of *null.Int. Feel free to fork if you disagree.