review feed back on URI

This commit is contained in:
Mike Farah
2023-01-25 11:18:48 +11:00
parent 6d7d76a3f1
commit 3b1bcac5b3
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func (e *uriEncoder) PrintLeadingContent(writer io.Writer, content string) error
func (e *uriEncoder) Encode(writer io.Writer, originalNode *yaml.Node) error {
node := unwrapDoc(originalNode)
if guessTagFromCustomType(node) != "!!str" {
return fmt.Errorf("cannot encode %v as url, 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 URI, can only operate on strings. Please first pipe through another encoding operator to convert the value to a string", node.Tag)
}
_, err := writer.Write([]byte(url.QueryEscape(originalNode.Value)))
return err