Y
Hacker News
new
|
ask
|
show
|
jobs
by
nolok
4481 days ago
Without actual example of what he does wrong and how it should be done, your post has very little value to a reader like me
1 comments
Jabbles
4481 days ago
e.g.
sync.Once() instead of init()
unhelpful named return parameters
didn't use range over channels
link
namelezz
4481 days ago
sync.Once() instead of init(). Having the Do closed to where the channels being used makes sure we do not run into deadlock. It's a nice pattern for lazy initializing of channels and goroutine too.
link
sync.Once() instead of init()
unhelpful named return parameters
didn't use range over channels