Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exported names #7

Open
johnabass opened this issue Feb 21, 2021 · 1 comment
Open

Exported names #7

johnabass opened this issue Feb 21, 2021 · 1 comment

Comments

@johnabass
Copy link
Contributor

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.

Excellent guidance on naming is in Effective Go:

https://golang.org/doc/effective_go#names

@Sachin4403
Copy link
Contributor

Hi @johnabass

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants