Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Comment
by
physicles
· 5y ago · 0 comments
If you only want to hold the lock for a portion of a function, pull that part out into its
own
function. Makes the code much easier to reason about. I consider .Unlock() without defer to be a code smell in nearly all cases.
Comments
No comments yet.
Better HN