Source File
listgroups_unix.go
Belonging Package
os/user
package user
import (
)
import _
const maxGroups = 2048
func listGroups(u *User) ([]string, error) {
ug, err := strconv.Atoi(u.Gid)
if err != nil {
return nil, fmt.Errorf("user: list groups for %s: invalid gid %q", u.Username, u.Gid)
}
userGID := /*line :29:13*/_Ctype_gid_t /*line :29:20*/(ug)
nameC := make([]byte, len(u.Username)+1)
copy(nameC, u.Username)
n := /*line :33:7*/_Ctype_int /*line :33:12*/(256)
gidsC := make([] /*line :34:18*/_Ctype_gid_t /*line :34:25*/, n)
rv := getGroupList((* /*line :35:23*/_Ctype_char /*line :35:29*/)(unsafe.Pointer(&nameC[0])), userGID, &gidsC[0], &n)
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |