Better string sub documentation

This commit is contained in:
Mike Farah
2021-04-16 16:07:40 +10:00
parent 6c26344449
commit b2a538bdfc
3 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ func substituteStringOperator(d *dataTreeNavigator, context Context, expressionN
candidate := el.Value.(*CandidateNode)
node := unwrapDoc(candidate.Node)
if node.Tag != "!!str" {
return Context{}, fmt.Errorf("cannot sustitute with %v, can only substitute strings", node.Tag)
return Context{}, fmt.Errorf("cannot substitute with %v, can only substitute strings. Hint: Most often you'll want to use '|=' over '=' for this operation.", node.Tag)
}
targetNode := substitute(node.Value, regEx, replacementText)