// This example shows how an error can be returned from a visitor function.
This example shows how an error can be returned from a visitor function.
// This example shows how an error can be returned from a visitor function .
func Example_error() {
	data, _ := demo.NewContainer(true)
	ret, changed, err := data.WalkTarget(
		func(ctx demo.TargetContext, x demo.Target) demo.TargetDecision {
			return ctx.Error(errors.New("an error"))
		})
	fmt.Println(ret, changed, err)
}
func Example_error ( ) { data , _ := demo . NewContainer ( true ) ret , changed , err := data . WalkTarget ( func ( ctx demo . TargetContext , x demo . Target ) demo . TargetDecision { return ctx . Error ( errors . New ( " " ) ) } ) fmt . Println ( ret , changed , err ) }
This example shows how an error can be returned from a visitor function.
This example shows how an error can be returned from a visitor function .
//Output: //<nil> false an error