mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Refactoring encoding configuration
This commit is contained in:
@@ -28,7 +28,7 @@ func (e *base64Encoder) PrintLeadingContent(_ io.Writer, _ string) error {
|
||||
|
||||
func (e *base64Encoder) Encode(writer io.Writer, node *CandidateNode) error {
|
||||
if node.guessTagFromCustomType() != "!!str" {
|
||||
return fmt.Errorf("cannot encode %v as base64, can only operate on strings. Please first pipe through another encoding operator to convert the value to a string", node.Tag)
|
||||
return fmt.Errorf("cannot encode %v as base64, can only operate on strings", node.Tag)
|
||||
}
|
||||
_, err := writer.Write([]byte(e.encoding.EncodeToString([]byte(node.Value))))
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user