user

最后更新于:2022-04-02 02:45:25

TOC] ## 语法 ``` type User struct { Uid string Gid string Username string Name string HomeDir string } type Group struct { Gid string // group ID Name string // group name } ``` ## 实例 ### Current ``` current, _ := user.Current() fmt.Printf("%+v\n", current) // &{Uid:0 Gid:0 Username:root Name:root HomeDir:/root} ``` ### Lookup ``` lookup, _ := user.Lookup("root") fmt.Println(lookup) ``` ### LookupId ### LookupGroup ### LookupGroupId
';