Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

expr.Disable*() functions are not working

未關閉
#841 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
go
領域
compilers

研究方向

首先使用 expr.Compile 和 conf.Config 重現 ./cmd 範例,檢查 c.Disabled 在編譯期間的套用方式。從編譯器進入點追蹤停用函式的路徑,並將其與回報的查詢 all(sandboxes, .Name startsWith 'frontend') 進行比較。停用 all 函式時,同一查詢會產生 expr.Compile 錯誤,即表示完成。

由索引模型根據 Issue 內容生成。

描述

feature

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
星號
8.1k
分支
534
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

expr-lang/expr 的其他 Issue

查看 expr-lang/expr 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。