package user
Import Path
os/user (on golang.org and go.dev )
Dependency Relation
imports 7 packages , and imported by 2 packages
Package-Level Type Names (total 26, in which 6 are exported)
/* sort exporteds by: alphabet | popularity */
type User (struct)
User represents a user account.
Fields (total 5, all are exported )
Gid string
Gid is the primary group ID.
On POSIX systems, this is a decimal number representing the gid.
On Windows, this is a SID in a string format.
On Plan 9, this is the contents of /dev/user.
HomeDir string
HomeDir is the path to the user's home directory (if they have one).
Name string
Name is the user's real or display name.
It might be blank.
On POSIX systems, this is the first (or only) entry in the GECOS field
list.
On Windows, this is the user's display name.
On Plan 9, this is the contents of /dev/user.
Uid string
Uid is the user ID.
On POSIX systems, this is a decimal number representing the uid.
On Windows, this is a security identifier (SID) in a string format.
On Plan 9, this is the contents of /dev/user.
Username string
Username is the login name.
Methods (only one, which is exported )
(*T) GroupIds () ([]string , error )
GroupIds returns the list of group IDs that the user is a member of.
As Outputs Of (at least 8, in which 3 are exported )
func Current () (*User , error )
func Lookup (username string ) (*User , error )
func LookupId (uid string ) (*User , error )
/* 5+ unexporteds ... */ /* 5+ unexporteds: */
func buildUser (pwd *_Ctype_struct_passwd ) *User
func current () (*User , error )
func lookupUnixUid (uid int ) (*User , error )
func lookupUser (username string ) (*User , error )
func lookupUserId (uid string ) (*User , error )
As Inputs Of (at least one unexported )
/* at least one unexported ... */ /* at least one unexported: */
func listGroups (u *User ) ([]string , error )
/* 20 unexporteds ... */ /* 20 unexporteds: */ type _Ctype___darwin_gid_t = _Ctype___uint32_t (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype___darwin_uid_t = _Ctype___uint32_t (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype___uint32_t = _Ctype_uint (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype_char int8 (basic type)
As Inputs Of (at least 10, none are exported )
/* 10+ unexporteds ... */ /* 10+ unexporteds: */
func _Cfunc_GoString (p *_Ctype_char ) string
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _cgo_runtime_gostring (*_Ctype_char ) string
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
type _Ctype_gid_t = _Ctype___darwin_gid_t (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype_int int32 (basic type)
As Outputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_sysconf (p0 _Ctype_int ) (r1 _Ctype_long )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype_size_t = _Ctype_ulong (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc__CMalloc (n _Ctype_size_t ) unsafe .Pointer
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_realloc (p0 unsafe .Pointer , p1 _Ctype_size_t ) (r1 unsafe .Pointer )
type _Ctype_struct_group (struct)
Fields (total 4, none are exported )
/* 4 unexporteds ... */ /* 4 unexporteds: */
gr_gid _Ctype_gid_t
gr_mem **_Ctype_char
gr_name *_Ctype_char
gr_passwd *_Ctype_char
As Inputs Of (at least 5, none are exported )
/* 5+ unexporteds ... */ /* 5+ unexporteds: */
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func buildGroup (grp *_Ctype_struct_group ) *Group
type _Ctype_struct_passwd (struct)
Fields (total 10, none are exported )
/* 10 unexporteds ... */ /* 10 unexporteds: */
pw_change _Ctype___darwin_time_t
pw_class *_Ctype_char
pw_dir *_Ctype_char
pw_expire _Ctype___darwin_time_t
pw_gecos *_Ctype_char
pw_gid _Ctype_gid_t
pw_name *_Ctype_char
pw_passwd *_Ctype_char
pw_shell *_Ctype_char
pw_uid _Ctype_uid_t
As Outputs Of (at least one unexported )
/* at least one unexported ... */ /* at least one unexported: */
func structPasswdForNegativeTest () _Ctype_struct_passwd
As Inputs Of (at least 5, none are exported )
/* 5+ unexporteds ... */ /* 5+ unexporteds: */
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func buildUser (pwd *_Ctype_struct_passwd ) *User
type _Ctype_uid_t = _Ctype___darwin_uid_t (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype_uint uint32 (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func _Cfunc_mygetgrouplist (p0 *_Ctype_char , p1 _Ctype_gid_t , p2 *_Ctype_gid_t , p3 *_Ctype_int ) (r1 _Ctype_int )
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func getGroupList (name *_Ctype_char , userGID _Ctype_gid_t , gids *_Ctype_gid_t , n *_Ctype_int ) _Ctype_int
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
func groupRetry (username string , name []byte , userGID _Ctype_gid_t , gids *[]_Ctype_gid_t , n *_Ctype_int ) error
type _Ctype_ulong uint64 (basic type)
As Inputs Of (at least 6, none are exported )
/* 6+ unexporteds ... */ /* 6+ unexporteds: */
func _Cfunc__CMalloc (n _Ctype_size_t ) unsafe .Pointer
func _Cfunc_mygetgrgid_r (p0 _Ctype_int , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetgrnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_group , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_group ) (r1 _Ctype_int )
func _Cfunc_mygetpwnam_r (p0 *_Ctype_char , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_mygetpwuid_r (p0 _Ctype_int , p1 *_Ctype_struct_passwd , p2 *_Ctype_char , p3 _Ctype_size_t , p4 **_Ctype_struct_passwd ) (r1 _Ctype_int )
func _Cfunc_realloc (p0 unsafe .Pointer , p1 _Ctype_size_t ) (r1 unsafe .Pointer )