I would suggest to use *function as type* and replace it at the run time
For more info visit these link:
https://gist.github.com/husobee/9ff87a6f27e9abb4a3bc
// now a patch example
> oldDoSomething := doSomething
> // reset func after completing method
> *defer func () { doSomething = oldDoSomethi
wrote:
> You could inject your dependencies. There is a funny talk by Liron Levin
> [1] which helped me a lot.
>
> 1: https://youtu.be/_B_vCEiO4mA
>
> prakash sharma schrieb am Sa. 11. Jan. 2020
> um 16:24:
>
>> Need help:
>>
>> https://stackoverflow.com/
Need help:
https://stackoverflow.com/questions/59693971/mocked-method-not-working-in-golang-while-running-the-test-cases
I am trying to mock an struct method in test cases but it is not working. I
want to mock *Validate* method here:
package main
import (
"fmt"
)
type DemoInterface interf