Documentation ¶
Overview ¶
Package strings provides string related utilities for testing purposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SliceDiffIgnoreOrder ¶
SliceDiffIgnoreOrder returns a human-readable diff of two string slices. Two slices are considered equal when they have the same length and same elements. The order of the elements is ignored while comparing. Nil and empty slices are considered equal.
This function is intended to be used in tests for comparing expected and actual values, and printing the diff for users to debug:
if diff := SliceDiffIgnoreOrder(got, want); diff != "" { t.Errorf("got: %v, want: %v, diff: %s", got, want, diff) }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.