|
|
|
|
|
by kubanczyk
867 days ago
|
|
I'm saying: - main constructor is easily available from the main type's docs, - option type is easily available from the main constructor's docs, - all option funcs are easily available from the option type's docs (because in fact these option funcs are constructors for the option type). Excerpt from grpc godoc index: type Server
func NewServer(opt ...ServerOption) *Server
...
...
type ServerOption
func ChainStreamInterceptor(interceptors ...StreamServerInterceptor) ServerOption
func ChainUnaryInterceptor(interceptors ...UnaryServerInterceptor) ServerOption
func ConnectionTimeout(d time.Duration) ServerOption
func Creds(c credentials.TransportCredentials) ServerOption
etc...
One more hop compared to a flat argument list, that's true. But if you only commonly use maybe 0-5 arguments out of 30-50 available, it does not look like a bad deal. |
|