title: Golang monkey patching
body: <p>I understand that if go code is structured such that it's programmed to interfaces, it's trivial to mock; however, I'm working with a code base that I cannot change (that is not mine) and this is not the case.  </p>
  
  <p>This code base is heavily interconnected and nothing is programmed to an interface, only structs, so no dependency injection.  </p>
  
  <p>The structs, themselves, only contain other structs, so I can't mock out that way either. I don't believe that I can do anything about methods, and the few functions that exist are not variables, so there's no way that I know of to swap them out. Inheritance isn't a thing in golang, so that's a no go as well.</p>
  
  <p>In scripting languages like python, we can modify the objects at runtime, aka monkey patch.  Is there something comparable that I can do in golang?  Trying to figure out some way to test/benchmark without touching the underlying code.</p>