Skip to content

Commit

Permalink
remove init entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Oct 4, 2022
1 parent 46c2a1f commit 393ac63
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions helper/users/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// lock is used to serialize all user lookup at the process level, because
// some NSS implementations are not concurrency safe
var lock *sync.Mutex
var lock sync.Mutex

// nobody is a cached copy of the nobody user, which is going to be looked-up
// frequently and is unlikely to be modified on the underlying system.
Expand All @@ -26,10 +26,6 @@ func Nobody() (*user.User, error) {
return u, err
}

func init() {
lock = new(sync.Mutex)
}

// Lookup username while holding a global process lock.
func Lookup(username string) (*user.User, error) {
lock.Lock()
Expand Down

0 comments on commit 393ac63

Please sign in to comment.