agiledragon / agiledragon/gomonkey

feature: replace the arguments of a function

オープン
#111 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。