News for hackers. Stuff that matters.
Re:How to Use Go Interfaces by vardump on Tuesday March 20, 2018 @04:56AM (#16626916)
X86 assembly rewriting software does exist. Although I'm not aware anyone ever using it for this purpose... yet.

Getting it to the point actual implementations are replaced by mocks at binary level... might be rather challenging.

(In Golang, tests mainly work like this: foo.go tests are in foo_test.go. "go test" would then run the unit tests for foo in foo_test.)

https://www.golang-book.com/books/intro/12

Re:How to Use Go Interfaces by pjmlp on Tuesday March 20, 2018 @05:42AM (#16627083)
Of course they do exist, but they are very fragile, usually only work in a very specific architecture, compiler version and compilation flags.

As for your test example, it doesn't work if you need to mock a library only available in binary form.