You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(From Go 1.21, [slices](https://pkg.go.dev/slices#pkg-overview) standard package is available, which has [slices.Equal](https://pkg.go.dev/slices#Equal) function to do a simple shallow compare on slices, where you don't need to worry about the types like the above case. Note that this function expects the elements to be [comparable](https://pkg.go.dev/builtin#comparable). So, it can't be applied to slices with non-comparable elements like 2D slices.)
Hey folks,
Would it make sense to add also the new way to compare slices in this chapter: https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/arrays-and-slices#write-enough-code-to-make-it-pass-4
So instead of using
reflect.DeepEqual
to useslices.Equal
.I could make a contribution to add this
The text was updated successfully, but these errors were encountered: