shithub: mycel

ref: a4ab438c7fa9478d4efd8128482cbddee9130ce1
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
}