Closed yaziine closed 5 years ago
I think this would be worth doing, although I think I'd make this the signature:
func New(cfg Config) (*Consumer, error)
That way we're free to return an error when the configuration is invalid and we lose the edge case of having a nil config.
As @rogpeppe duly noticed, the actual Consumer's API can lead to several mistakes if it is not configured properly.
The idea is to add a constructor for the Consumer which holds a ready to use configuration, something like the following:
This is a big breaking changes but as we are still in v0.x.x, it is still the time to break the API.
What do you think guys @rogpeppe @tealeg @asdine?