agiledragon / agiledragon/gomonkey
feature: replace the arguments of a function
オープン
- 主要言語
- Go
- スター
- 2.3k
- フォーク
- 192
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 1
説明
Is there a more appropriate way to change the parameters of a function?
more complicated way....
```golang
var patchReadDir = gomonkey.NewPatches()
var readDir func(name string) ([]os.DirEntry, error)
readDir = func(name string) ([]os.DirEntry, error) {
patchReadDir.Reset()
defer patchReadDir.ApplyFunc(os.ReadDir, readDir)
return os.ReadDir(filepath.Join(c.baseDir, name))
}
patchReadDir.ApplyFunc(os.ReadDir, readDir)
c.patches = append(c.patches, patchReadDir)
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。