4 ms·
Uh what? No, that couldn't possibly be less true. Have you ever heard of "interfaces" in Go? They're kind of an important feature.
by drivebyacct2 14y ago
Uh what? No, that couldn't possibly be less true. Have you ever heard of "interfaces" in Go? They're kind of an important feature.
- trungonnews 14y agoThat's what the other gophers say too. Java has interfaces too, but it also has Mockito that makes testing much easier. You should look into it. Mocking library will help reduce boiler code. You would know that if you had used one.
- drivebyacct2 14y ago>You would know that if you had used one. Cute.
- trungonnews 14y agoMy bad. :)
- burntsushi 14y agoGo interfaces are not the same as Java interfaces. Go interfaces are implemented using structural sub-typing.
- prodigal_erik 14y agoI've only dabbled a bit but I haven't seen a DSL that easily creates a mock that implements all the methods of a given interface, verifies that methods were (not) called with expected arguments, and returns or throws canned values. It's not difficult to write mocks from scratch, but it's very repetitive and hard to skim what the test does.
- trungonnews 14y agoYou nailed it!