Categorygithub.com/matt9mg/go-slice-diff
modulepackage
1.1.1
Repository: https://github.com/matt9mg/go-slice-diff.git
Documentation: pkg.go.dev

# README

Go Reference

Slice Diff

Returns the difference between two slices

Installation

go get github.com/mtdevs28080617/go-slice-diff

Examples

listA := []string{"A", "B", "C"}
listB := []string{"A", "B", "D"}

diff := slice_diff.SliceDiff[string](listA, listB)

log.Println(diff) // []string{"D"}

listA := []int{1, 2, 3}
listB := []int{1, 2, 4}

diff := slice_diff.SliceDiff[int](listA, listB)

log.Println(diff) // []int{4}

# Functions

SliceDiff takes 2 slices of the same type and returns the difference The difference returned is what listB does not match within listA.