Re:REST Servers in Go: Part 1 – standard library
by physicles on Sunday January 17, 2021 @08:39PM
(#25817269)
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.
[ Parent
| on HN ]
There are no comments on this comment yet.