Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PatchGuard ¶
type PatchGuard struct {
// contains filtered or unexported fields
}
PatchGuard contains original and patch data for unpatch.
func Patch ¶
func Patch(target, patch interface{}) *PatchGuard
Patch is used to patch common function.
func PatchMethod ¶
func PatchMethod(target interface{}, method string, patch interface{}) *PatchGuard
PatchMethod is used to patch structure methods, it supports private methods and private structure public and private methods, usually the private structure is from interface.
func (*PatchGuard) Restore ¶
func (pg *PatchGuard) Restore()
Restore is used to patch the target again.
func (*PatchGuard) Unpatch ¶
func (pg *PatchGuard) Unpatch()
Unpatch is used to recovery the original about target.
Click to show internal directories.
Click to hide internal directories.