func SetOwnership(filePath string, wantedUser string, wantedGroup string) error {
	group, err := user.LookupGroup(wantedGroup)
	if err != nil {
		return errors.Trace(err)
	}
	gid, err := strconv.Atoi(group.Gid)
	if err != nil {
		return errors.Trace(err)
	}
	usr, err := user.Lookup(wantedUser)
	if err != nil {
		return errors.Trace(err)
	}
	uid, err := strconv.Atoi(usr.Uid)
	if err != nil {
		return errors.Trace(err)
	}
	return Chown(filePath, uid, gid)
}
// SetOwnership sets the ownership of a given file from a path.
// Searches for the corresponding id's from user, group and uses them to chown.
SetOwnership sets the ownership of a given file from a path.
Searches for the corresponding id's from user, group and uses them to chown.
// SetOwnership sets the ownership of a given file from a path . // Searches for the corresponding id ' s from user group and uses them to chown .
func SetOwnership(filePath string, wantedUser string, wantedGroup string) error {
	group, err := user.LookupGroup(wantedGroup)
	if err != nil {
		return errors.Trace(err)
	}
	gid, err := strconv.Atoi(group.Gid)
	if err != nil {
		return errors.Trace(err)
	}
	usr, err := user.Lookup(wantedUser)
	if err != nil {
		return errors.Trace(err)
	}
	uid, err := strconv.Atoi(usr.Uid)
	if err != nil {
		return errors.Trace(err)
	}
	return Chown(filePath, uid, gid)
}
func SetOwnership ( filePath string , wantedUser string , wantedGroup string ) error { group , err := user . LookupGroup ( wantedGroup ) if err != nil { return errors . Trace ( err ) } gid , err := strconv . Atoi ( group . Gid ) if err != nil { return errors . Trace ( err ) } usr , err := user . Lookup ( wantedUser ) if err != nil { return errors . Trace ( err ) } uid , err := strconv . Atoi ( usr . Uid ) if err != nil { return errors . Trace ( err ) } return Chown ( filePath , uid , gid ) }
SetOwnership sets the ownership of a given file from a path.
SetOwnership sets the ownership of a given file from a path .