|
|
|
|
|
by EdSchouten
2272 days ago
|
|
With regards that anything can be streamlined: sure, but it’s also about the amount of investment that would take. You could spend days or weeks to automate all of this for C. Meanwhile for Go there exists a tool called ‘mockgen’ (https://github.com/golang/mock) that can automatically stomp out mocks for any interface type declared in code. Not just for the ones in your codebase, literally arbitrary ones: interfaces part of the Go standard library, ones that are declared in third-party dependencies. The fact that you hate function pointers and void* context pointers is an exact confirmation of my premise: people think it’s too much of a hassle. |
|
As for mocks, the fact that they're hard to do in C may be a feature in disguise...