Allow mockable/predictable now()
维护者通常 1 天内回复
评估
调研方向
未指定文件或测试。先定位 Go 表达式求值器中 now() 的实现和调用路径,然后检查测试或配置选项是如何提供的。完成标准是测试可以提供一个可预测且可设置的时间,并且可以据此验证使用 now() 的表达式。
由索引模型根据 Issue 内容生成。
描述
Its hard to test out programs that rely on time for example:
now().Sub(StartTime) >= 40*duration("24h")
Would it be possible to allow a testing option for now() to give a predictable/settable time?
- 主要语言
- Go
- 星标
- 8.1k
- 派生
- 544
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 25
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
expr-lang/expr 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
count() without a predicate compiles for non-bool arrays and fails at run time可能已有人在做 @minilan677-netizen 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 25/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 57/100
维护者通常 1 天内回复
-
wontfix
难度 4/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
`find`, `findIndex`, `first` and `get` are type-checked as the element type where they return nil可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind可能已有人在做 @arshil42 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)未关闭cost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
难度 2/5 1-3 小时 新手友好度 88/100
sisaku-security/sisakulint#860 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 78/100
openshift/sandboxed-containers-operator#4072 ·
维护者通常 1 天内回复
-
Correct local module testing instructions for Go sample contributors可能已有人在做 @slievrly 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100