Skip to content

Exported names #7

@johnabass

Description

@johnabass

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions