gotestyourself / gotestyourself/gotest.tools

Consider making `assert.Equal` generic?

Open
#292 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
576
Forks
54
Avg merge
6d 3h
Merged PRs (30d)
2

Description

One of the benefits I often hear of "not using an assertion library" is that it makes equality comparisons type-safe (especially easy to get wrong when comparing eg specific numeric types).

I saw another assertion library recently https://github.com/alecthomas/assert that is heavily inspired by `testify`, but has made some of its funcs generic, to aid with this.

```go

func Equal[T any](t testing.TB, expected, actual T, msgArgsAndCompareOptions ...any)

```

Is this something `gotest.tools` could consider?

Would it necessitate v3?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.