opened
mmasztalerczuk
username_0
Hello,
I have a small fix related to logging. Due to implementation, there is impossible to start to debug mode from the beginning. So, I have a proposition to add not required parameter which will make this possible.  
There is an issue for that - https://github.com/emersion/go-imap/issues/175. 

What do you think about it?
Fix missing first debug log
issue
created
foxcpp
username_1
IMO that's a weird implementation that loses type safety and makes code much less self-documenting.
If I wanted to introduce a lot of optional arguments that should be set early - I would prefer to have New and NewWithOpts functions with the latter accepting Opts structure with all arguments.
In way similar to how I did it in go-imap-sql: https://godoc.org/github.com/username_1/go-imap-sql#New
comment
created
mmasztalerczuk
username_0
Yep, my implementation has a problem with type safety. 

I was thinking about something similar to your proposition, but in this proposition, I need to implement a new version of DialWithDialerTLS,  DialTLS, DialWithDialer, Dialer, and New. That is a lot of new functions. 

If this is ok, then I can change my proposition for something like that.
comment
created
foxcpp
username_1
DialWithDialer can be dropped in favor of Opts.Dialer. Or left as is if we consider the whole Dial family as a "convenience wrappers" and say that people who need more control should use New directly.
comment
created
mmasztalerczuk
username_0
Ok, that makes sense. I will create an only new version of New function.
comment