expr.Disable*() functions are not working
还没有人认领这个 Issue。
评估
调研方向
首先使用 expr.Compile 和 conf.Config 重现 ./cmd 示例,检查 c.Disabled 在编译期间的应用方式。从编译器入口点追踪禁用函数的路径,并将其与报告的查询 all(sandboxes, .Name startsWith 'frontend') 进行比较。当禁用 all 函数时,同一查询产生 expr.Compile 错误,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Go
- 星标
- 8k
- 派生
- 535
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
expr-lang/expr 的其他 Issue
-
Docs: Built in functions shadow user variables可能已有人在做 @sanmaxdev 于 93 天前认领。 未关闭docs needed
难度 1/5 1-3 小时 新手友好度 62/100
-
`in` operator on a struct doesn't respect `expr` tags可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
-
`find`, `findIndex`, `first` and `get` are type-checked as the element type where they return nil可能已有人在做 @TastyHeadphones 于 9 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
status:approved type:bug
难度 2/5 1-3 小时 新手友好度 85/100
Gentleman-Programming/gentle-ai#5326 ·
维护者通常 1 天内回复
-
area/testing kind/cleanup priority/backlog triage/accepted
难度 2/5 1-3 小时 新手友好度 78/100
lexfrei/cloudflare-tunnel-gateway-controller#999 ·
维护者通常 1 天内回复
-
automation models
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Can the search results with Year Released be in enclosed in the ( ) like Movie/TV(Year Released)未关闭
难度 2/5 1-3 小时 新手友好度 85/100
Dhairya3391/kari#32 ·