Skip to content

Why does NewSet() take optional elements but NewThreadUnsafeSet() doesn't? #80

@jeffwidman

Description

@jeffwidman

It's weird that NewThreadUnsafeSet() doesn't take optional elements and includes them in the returned set.

The ergonomics of NewSet(... interface{}) are much nicer!

Also, the docs for NewSet() say it returns an empty set, yet that's not necessarily true... I was going to open a PR to fix that when I noticed the inconsistency with NewThreadUnsafeSet().

So would you rather they both take optional args, or neither?

IMO the former is both backwards compatible and also a more pleasant API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions