diff --git a/src/os/user/lookup.go b/src/os/user/lookup.go index 2243a25788..b36b7c01c0 100644 --- a/src/os/user/lookup.go +++ b/src/os/user/lookup.go @@ -7,6 +7,10 @@ package user import "sync" // Current returns the current user. +// +// The first call will cache the current user information. +// Subsequent calls will return the cached value and will not reflect +// changes to the current user. func Current() (*User, error) { cache.Do(func() { cache.u, cache.err = current() }) if cache.err != nil {