diff --git a/semaphore/semaphore.go b/semaphore/semaphore.go index 040c5bc..b4c3393 100644 --- a/semaphore/semaphore.go +++ b/semaphore/semaphore.go @@ -19,8 +19,7 @@ type waiter struct { // NewWeighted creates a new weighted semaphore with the given // maximum combined weight for concurrent access. func NewWeighted(n int64) *Weighted { - w := &Weighted{size: n} - return w + return &Weighted{size: n} } // Weighted provides a way to bound concurrent access to a resource.