Advanced go - Avoiding `if` for initialization using `sync.Once` and foot guns to watch out for
We already discussed when to use constructors and when let the user of your library initialize their structures.
The short version is that if the structure makes sense and can be used as zero value, or with some fields unset. Or, in other words, if ...
pauldigian.com8 min read
Blia Xiong
I really like your articles on advance Go. Keep writing them. Thanks!