code: func AskForPassword(ctx context.Context, name string) (string, error) {
  	if ctxutil.IsAlwaysYes(ctx) {
  		return "", nil
  	}
  
  	askFn := GetPassPromptFunc(ctx)
  	for i := 0; i < maxTries; i++ {
  		// check for context cancelation
  		select {
  		case <-ctx.Done():
  			return "", ErrAborted
  		default:
  		}
  
  		pass, err := askFn(ctx, fmt.Sprintf("Enter password for %s", name))
  		if err != nil {
  			return "", err
  		}
  
  		passAgain, err := askFn(ctx, fmt.Sprintf("Retype password for %s", name))
  		if err != nil {
  			return "", err
  		}
  
  		if pass == passAgain || pass == "" {
  			return pass, nil
  		}
  
  		out.Error(ctx, "Error: the entered password do not match")
  	}
  	return "", errors.New("no valid user input")
  }
docs: // AskForPassword prompts for a password twice until both match