techn00
Joined 6 years ago
Joined 6 years ago
I just don't like these DI systems that pull stuff "out of thin air" auto-magically instead of just passing arguments.
I wasn't aware of this library, I did check for name collisions with other Go repos though
You're not forced to use that comment, you can pass the event however you like, if you satisfy the event.Any interface (by having the method EventName() string).
I prefer that comment because Go doesn't have native sum types, and I believe that by using the framework in combination with the gochecksumtype linter, you get the best developer experience and type safety (you DO have tab autocomplete with the events for recordThat - the type system helps because of the sealed interface).
But again, if you don't want to use the linter, no problem. You can create constructors for the events however you like, just like in your example.
I'd be more interested on how to find people like Jon tbh.