Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For testing I wrote https://github.com/jamesrr39/go-mockgen-tool to generate mock implementations of a given interface. It's a different approach from the normal reflect and interface{}... heavy libraries. Might be interesting!


Quite reasonable! I think if you keep your interfaces small, you might not need it, but if you do have a couple of beefy interfaces, then this is a lot more pleasant than using a dedicated mock framework. A function is a great way to mock a function -- you can do anything! ;)


Looks interesting! Reminds me impl[0], which comes bundled with `vscode-golang`.

[0]: https://github.com/josharian/impl




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: