Skip to content

Use init() instead of sync.Once to initiate default entropy #96

@ivanjaros

Description

@ivanjaros

In the DefaultEntropy you are using sync.Once to initiate the entropy and new reader. This means that every call to Make() has to make atomic call to see if sync.Once has been invoked. This seems very pointless when you could have simply used init(), which is run only once, and poses no performance hit. Especially when this is not ephemeral code but rather eternal and called many many many times.

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