Skip to content

bartmika/arraydiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arraydiff

GoDoc Go Report Card License Go version

Convenience functions to help you find content differences in your arrays. Fully unit-tested.

Installation

In your Golang project, please run:

go get github.com/bartmika/arraydiff

Documentation

All documentation can be found here.

Example Usage

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
    }
)

Contributing

Found a bug? Want a feature to improve your developer experience when finding the difference? Please create an issue.

License

Made with ❤️ by Bartlomiej Mika.
The project is licensed under the ISC License.

About

Golang package to help you diff content between arrays

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages