expr icon indicating copy to clipboard operation
expr copied to clipboard

expr.Disable*() functions are not working

Open davixcky opened this issue 3 months ago • 1 comments

I want to disable some functions, but seems like is not working

	program, err := expr.Compile(query, expr.Option(func(c *conf.Config) {
		c.Disabled["all"] = true

		for name := range c.Disabled {
			fmt.Println("Disabled...", name)
		}
	}))
	if err != nil {
		return nil, fmt.Errorf("error compiling query: %v", err)
	}

I even tested with the builtin function, but doesn't work

./cmd  -q "all(sandboxes, .Name startsWith 'frontend')"
Compiling query... 2 all(sandboxes, .Name startsWith 'frontend') for entity type... sandbox
Options... [0x5f3ae0 0x5f3ac0 0x5f3aa0 0x5f4180 0x5f3a40]
Disabled... all
false

Expected To see an error expr.Compile

davixcky avatar Sep 18 '25 20:09 davixcky

Well, disabling built-in predicates is kind of its own separate feature.

antonmedv avatar Sep 22 '25 18:09 antonmedv