Skip to content

Commit

Permalink
Merge pull request #39 from gofrs/remove_equal_function
Browse files Browse the repository at this point in the history
Remove the deprecated Equal function (in preparation for v3.0.0)

Signed-off-by: Tim Heckman <t@heckman.io>
  • Loading branch information
theckman committed Aug 2, 2018
2 parents 8ac5729 + 0f0e88a commit c52a240
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
8 changes: 0 additions & 8 deletions uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ var (
NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
)

// Equal returns true if a and b are equivalent.
//
// Deprecated: this function is deprecated and will be removed in a future major
// version, as values of type UUID are directly comparable using `==`.
func Equal(a UUID, b UUID) bool {
return a == b
}

// Version returns the algorithm version used to generate the UUID.
func (u UUID) Version() byte {
return u[6] >> 4
Expand Down
9 changes: 0 additions & 9 deletions uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@ func testUUIDSetVariant(t *testing.T) {
}
}

func TestEqual(t *testing.T) {
if !Equal(NamespaceDNS, NamespaceDNS) {
t.Errorf("NamespaceDNS (%v) != NamespaceDNS (%v)", NamespaceDNS, NamespaceDNS)
}
if Equal(NamespaceDNS, NamespaceURL) {
t.Errorf("NamespaceDNS (%v) == NamespaceURL (%v)", NamespaceDNS, NamespaceURL)
}
}

func TestMust(t *testing.T) {
sentinel := fmt.Errorf("uuid: sentinel error")
defer func() {
Expand Down

0 comments on commit c52a240

Please sign in to comment.