compare

package
v2.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONCompare

func JSONCompare(want, have []byte) (eq bool, err error)

JSONCompare compares two JSON byte slices for semantic equality. It considers: - Maps: all keys must exist and values must match recursively - Slices: all elements from 'want' must exist in 'have' (order independent) - Primitive types: strict equality comparison

Returns:

  • eq: true if the JSON structures are semantically equal
  • err: error describing the first difference found, nil if equal

Types

This section is empty.

Jump to

Keyboard shortcuts

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