strings

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func SliceDiffIgnoreOrder(a, b []string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL