agiledragon / agiledragon/gomonkey

ApplyFuncVar和ApplyFunc有什么区别?

未关闭
#135 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
2.3k
派生
192
平均合并
1 天 6 小时
30 天内合并 PR
1

描述

Convey("for succ", func() {
str := "hello"
patches := ApplyFuncVar(&fake.Marshal, func (_ interface{}) ([]byte, error) {
return []byte(str), nil
})
defer patches.Reset()
bytes, err := fake.Marshal(nil)
So(err, ShouldEqual, nil)
So(string(bytes), ShouldEqual, str)
})

ApplyFuncVar替换为ApplyFunc不也是同样的效果?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。