2 ms·
I favor an DI style as well, but sometimes in rare cases I like using the init functions. This boils down to functions which follow the template.Must pattern,
by weitzj 9y ago
I favor an DI style as well, but sometimes in rare cases I like using the init functions.
This boils down to functions which follow the template.Must pattern, i.e.: either the function can be evaluated or the program should panic.
The other case is read-only lookup tables.