user/group.go
func GetgroupsName() []string {
	user := GetUsername()
	list := make([]string, 0)

	// The user could have its own group.
	if _, err := LookupGroup(user); err == nil {
		list = append(list, user)
	}

	groups, err := LookupInGroup(G_MEMBER, user, -1)
	if err != nil {
		if _, ok := err.(NoFoundError); !ok {
			panic(err)
		}
	}
	for _, v := range groups {
		list = append(list, v.Name)
	}

	return list
}
func GetgroupsName() []string {
	user := GetUsername()
	list := make([]string, 0)

	// The user could have its own group.
	if _, err := LookupGroup(user); err == nil {
		list = append(list, user)
	}

	groups, err := LookupInGroup(G_MEMBER, user, -1)
	if err != nil {
		if _, ok := err.(NoFoundError); !ok {
			panic(err)
		}
	}
	for _, v := range groups {
		list = append(list, v.Name)
	}

	return list
}
func GetgroupsName ( ) [ ] string { user := GetUsername ( ) list := make ( [ ] string , 0 ) // The user could have its own group. if _ , err := LookupGroup ( user ) ; err == nil { list = append ( list , user ) } groups , err := LookupInGroup ( G_MEMBER , user , - 1 ) if err != nil { if _ , ok := err . ( NoFoundError ) ; ! ok { panic ( err ) } } for _ , v := range groups { list = append ( list , v . Name ) } return list }
// GetgroupsName returns a list of the groups that the caller belongs to.
GetgroupsName returns a list of the groups that the caller belongs to .