Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
euroderf
on Jan 5, 2024
|
parent
|
context
|
favorite
| on:
Go: What we got right, what we got wrong
> when you need to identify the difference between unset and zero.
Use pointer variables ? Works 4 me.
campbel
on Jan 5, 2024
[–]
Also what I do. You could theoretically also create your own type that manages deserialization and includes an "is_set" field.
euroderf
on Jan 6, 2024
|
parent
[–]
FWIW: calling Error() on a nil error is an obnoxious NPE fail, so I made this:
https://pkg.go.dev/github.com/fbaube/miscutils#Errer
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Use pointer variables ? Works 4 me.