Skip to content

patch fun after how get origin fun #12

@zeromake

Description

@zeromake

not use UnPatch

package main

import (
	"fmt"
	sm "github.com/cch123/supermonkey"
	"time"
)
//go:noinline
func Now() time.Time {
	return time.Time{}
}

func main() {
	sm.Patch(time.Now, Now)
	fmt.Println(time.Now())
	// how call origin Now fun
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions