Closed u2386 closed 3 years ago
As far as my concern, the restore method that is redundant, but I'd like to try to fix it (please wait a moment).
This is my way #17 @u2386
the restore method that is redundant
Restore is quite useful, e.g
var guard *supermonkey.PatchGuard
guard = supermonkey.PatchByFullSymbolName(time.Now, func() time.Time {
guard.Unpatch()
defer guard.Restore()
actual := time.Now()
manipulated := actual.Add(time.Hour)
return manipulated
})
the restore method that is redundant
Restore is quite useful, e.g
var guard *supermonkey.PatchGuard guard = supermonkey.PatchByFullSymbolName(time.Now, func() time.Time { guard.Unpatch() defer guard.Restore() actual := time.Now() manipulated := actual.Add(time.Hour) return manipulated })
@Mutated1994
the restore method that is redundant
Restore is quite useful, e.g
var guard *supermonkey.PatchGuard guard = supermonkey.PatchByFullSymbolName(time.Now, func() time.Time { guard.Unpatch() defer guard.Restore() actual := time.Now() manipulated := actual.Add(time.Hour) return manipulated })
@Mutated1994
Sorry, I'm late. @u2386 Dude, I've changed my mind. You are right in your case! @u2386 @cch123 I've fixed this issue. #17
https://github.com/cch123/supermonkey/pull/17 is merged, so close this ~
15