Skip to content

cmp: package name collides with de facto stdlib 'go-cmp'  #61535

Closed as not planned
@bitfield

Description

@bitfield

I missed the memo where constraints was renamed to cmp, but if I'd seen it, I would have pointed out that this name collides with an extremely widely-used package, go-cmp/cmp. As in, for example:

if !cmp.Equal(want, got) {
  t.Error(cmp.Diff(want, got))
}

Sure, the stdlib is privileged: it can name packages whatever it wants, and it's for third-party package authors to change their names to avoid collisions. But, in this case, go-cmp was there first, and it's so commonly used I'd say it's part of the de facto stdlib.

I'd like to see a cmp package in Go, and I'd like it to have the functionality of go-cmp (I think this has been proposed). Until then, I think it would be wise to keep this part of the namespace open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions