shithub: mycel

ref: c70619eff54eb25a853b850ac7ccb2f447658519
dir: /opossum_unix.go/

View raw version
// +build !plan9

package opossum

import (
	"fmt"
	"os/user"
)

func Group(u *user.User) (string, error) {
	g, err := user.LookupGroupId(u.Gid)
	if err != nil {
		return "", fmt.Errorf("get group: %w", err)
	}
	return g.Name, nil
}