From 6fa7022d8bcf028feb7a8ef41fc6dc35d735abfb Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 21 Jun 2024 14:45:50 +0200 Subject: [PATCH] plugin: fix Plugin.Confirm --- plugin/plugin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/plugin.go b/plugin/plugin.go index e0420036..5a83c092 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -2,7 +2,6 @@ package plugin import ( "bufio" - "encoding/base64" "errors" "flag" "fmt" @@ -14,6 +13,7 @@ import ( ) // TODO: add examples. +// TODO: add plugin test framework. // Plugin is a framework for writing age plugins. It allows exposing regular // [age.Recipient] and [age.Identity] implementations as plugins, and handles @@ -485,9 +485,9 @@ func (p *Plugin) RequestValue(prompt string, secret bool) (string, error) { // // It must only be called by a Wrap or Unwrap method invoked by [Plugin.Main]. func (p *Plugin) Confirm(prompt, yes, no string) (choseYes bool, err error) { - args := []string{base64.StdEncoding.EncodeToString([]byte(yes))} + args := []string{format.EncodeToString([]byte(yes))} if no != "" { - args = append(args, base64.StdEncoding.EncodeToString([]byte(no))) + args = append(args, format.EncodeToString([]byte(no))) } s := &format.Stanza{Type: "confirm", Args: args, Body: []byte(prompt)} if err := s.Marshal(os.Stdout); err != nil {