shithub: mycel

ref: 42c4bda7ce787bb674af94b96cf901efbfc342ed
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
}