Help us shape the future of Go! Take the 2026 Go Developer Survey

lib

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(m map[string]string) map[string]string

Makes a copy of a map

func GetDifferenceBetweenStrings

func GetDifferenceBetweenStrings(a, b string) string

func GetHomeDirectory

func GetHomeDirectory() (string, error)

func Max added in v0.1.0

func Max(x, y int) int

Max returns the larger of x or y.

func MergeMaps

func MergeMaps(a, b map[string]string) map[string]string

Merge two maps together.

func OrderJsonFields

func OrderJsonFields(jsonStr string) (string, error)

Types

type ComparisonResult

type ComparisonResult struct {
	AboveThreshold bool
	Score          float64
}

func CompareJsonStrings

func CompareJsonStrings(
	actualJson string,
	expectedJson string,
	threshold float64,
) (ComparisonResult, error)

Compare two JSON strings by ordering the fields alphabetically and then comparing the strings using the Jaro-Winkler algorithm to compute a score. If the score is greater than the threshold, return true.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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