You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
candlelight primarily concerns itself with tracing. Therefore, putting trace in exported names is redundant. ConfigureTracerProvider and TraceMiddleware would be better as ConfigureProvider and Middleware respectively.
The motivation is how this code looks from a client perspective. Recall that in golang, one cannot elide the package name. A client sees candlelight.ConfigureTracerProvider and candlelight.TraceMiddleware. Both are overly verbose if the candlelight package doesn't create any other kinds of provider or middleware.
Additionally, if ConfigureProvider is playing the role of a constructor, then NewProvider would be a better name.
In the future when we will have support for metrics and other things then this function name ConfigureTraceProvider, TraceMiddleware will help us to easily identify what this function is doing.
candlelight
primarily concerns itself with tracing. Therefore, puttingtrace
in exported names is redundant.ConfigureTracerProvider
andTraceMiddleware
would be better asConfigureProvider
andMiddleware
respectively.The motivation is how this code looks from a client perspective. Recall that in
golang
, one cannot elide the package name. A client seescandlelight.ConfigureTracerProvider
andcandlelight.TraceMiddleware
. Both are overly verbose if thecandlelight
package doesn't create any other kinds of provider or middleware.Additionally, if
ConfigureProvider
is playing the role of a constructor, thenNewProvider
would be a better name.Excellent guidance on naming is in Effective Go:
https://golang.org/doc/effective_go#names
The text was updated successfully, but these errors were encountered: