shithub: mycel

ref: 0acd11cce3163383d1c9d2bb9954f05492e4ff0a
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
}