func (u *SessionUtil) DoesUserExist(username string) (bool, error) {
	shellCmdArgs := append(ShellPluginCommandArgs, fmt.Sprintf("id %s", username))
	cmd := exec.Command(ShellPluginCommandName, shellCmdArgs...)
	if err := cmd.Run(); err != nil {
		if exitErr, ok := err.(*exec.ExitError); ok {
			// The program has exited with an exit code != 0
			return false, fmt.Errorf("encountered an error while checking for %s: %v", appconfig.DefaultRunAsUserName, exitErr.Error())
		}
		return false, nil
	}
	return true, nil
}
// DoesUserExist checks if given user already exists
DoesUserExist checks if given user already exists
// DoesUserExist checks if given user already exists
func (u *SessionUtil) DoesUserExist(username string) (bool, error) {
	shellCmdArgs := append(ShellPluginCommandArgs, fmt.Sprintf("id %s", username))
	cmd := exec.Command(ShellPluginCommandName, shellCmdArgs...)
	if err := cmd.Run(); err != nil {
		if exitErr, ok := err.(*exec.ExitError); ok {
			return false, fmt.Errorf("encountered an error while checking for %s: %v", appconfig.DefaultRunAsUserName, exitErr.Error())
		}
		return false, nil
	}
	return true, nil
}
func ( u * SessionUtil ) DoesUserExist ( username string ) ( bool , error ) { shellCmdArgs := append ( ShellPluginCommandArgs , fmt . Sprintf ( " " , username ) ) cmd := exec . Command ( ShellPluginCommandName , shellCmdArgs ... ) if err := cmd . Run ( ) ; err != nil { if exitErr , ok := err . ( * exec . ExitError ) ; ok { return false , fmt . Errorf ( " " , appconfig . DefaultRunAsUserName , exitErr . Error ( ) ) } return false , nil } return true , nil }
DoesUserExist checks if given user already exists
DoesUserExist checks if given user already exists
// The program has exited with an exit code != 0