shithub: mycel

ref: 20c9b3b3afc19bfc4cb218e7b0bd891f529f5a4e
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
}