You can use delegation approach as mentioned here:
// now a patch example oldDoSomething := doSomething // reset func after completing method defer func () { doSomething = oldDoSomething}() doSomething = func(s SomethingInterface) bool { return true }
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9ef764d2-060d-4451-b1d9-034285e524ee%40googlegroups.com.
I would suggest to use function as type and replace it at the run timeFor more info visit these link:You can use delegation approach as mentioned here:
// now a patch example oldDoSomething := doSomething // reset func after completing method defer func () { doSomething = oldDoSomething}() doSomething = func(s SomethingInterface) bool { return true } Hope this helps.
On Sun, 12 Jan, 2020, 11:46 PM Ori Newman, <orine...@gmail.com> wrote:
Hi,--I know https://github.com/bouk/monkey , but it has a very restrictive license (it says "I do not give anyone permissions to use this tool for any purpose. Don't use it.").Someone knows an alternative with a better license?Thanks in advance
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
If you call through an interface, you get runtime, dynamic dispatch.
This message contains confidential information and is intended only for the individual to whom it is addressed. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and permanently delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, late or incomplete, or could contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version from the sender. Druva, www.druva.com