From 67b4f74375c5555746508b2c53a5e48c695f7751 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 26 May 2025 08:07:49 +0200 Subject: [PATCH] Do not repeat patcher definition in ExamplePatch() I suppose at some point, godoc was not smart enough to display the definitions used in the body of examples in the documentation. This is not the case anymore: https://pkg.go.dev/github.com/expr-lang/expr#example-Patch --- expr_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/expr_test.go b/expr_test.go index faa5cae6..241767a0 100644 --- a/expr_test.go +++ b/expr_test.go @@ -504,20 +504,6 @@ func (p *patcher) Visit(node *ast.Node) { } func ExamplePatch() { - /* - type patcher struct{} - - func (p *patcher) Visit(node *ast.Node) { - switch n := (*node).(type) { - case *ast.MemberNode: - ast.Patch(node, &ast.CallNode{ - Callee: &ast.IdentifierNode{Value: "get"}, - Arguments: []ast.Node{n.Node, n.Property}, - }) - } - } - */ - program, err := expr.Compile( `greet.you.world + "!"`, expr.Patch(&patcher{}),