Convenience functions to help you find content differences in your arrays. Fully unit-tested.
In your Golang project, please run:
go get github.com/bartmika/arraydiff
All documentation can be found here.
package main
import (
"fmt"
"github.com/bartmika/arraydiff"
func main(){
// Sample data.
oldArr := []uint64{1, 2, 3, 4, 5}
newArr := []uint64{1, 2, 6, 7, 8, 9, 10}
// See what are the differences between the two arrays of type `uint64` data-types.
addedArr, sameArr, removedArr := arraydiff.Uints64(oldArr, newArr)
// Correct results shown in comments.
fmt.Println(addedArr) // 6, 7, 8, 9, 10
fmt.Println(sameArr) // 1, 2
fmt.Println(removedArr) // 3, 4, 5
}
)
Found a bug? Want a feature to improve your developer experience when finding the difference? Please create an issue.
Made with ❤️ by Bartlomiej Mika.
The project is licensed under the ISC License.