Skip to content

Allow to override builtins with user env #520

@isubasinghe

Description

@isubasinghe

There are scenarios where Eval is called with keywords being present in the expression itself.
These can fail because of the type checking.

func nameclash() {
  env := make[string]any{
    "foo": 1,
    "split": 2
  }
  output, err := expr.Eval("foo + split", env)
  if err != nil {
    // currently this branch will be reached
    return;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions