How can I get workflow context in activity?

I want to use workflow.sleep() in activity, but sleep method need workflow context as his first param in golang sdk,

You don’t need workflow.Sleep inside the activity. Use time.Sleep instead…

But when I use time.Sleep in activity, I will get potential dead lock err

You will not. The deadlock error can happen only if you use time.Sleep inside a workflow code.