Skip to content

A collection of helper functions to determine the deltas of various Go "objects"

License

Notifications You must be signed in to change notification settings

jsimnz/go-delta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-diff

A (soon to be) collection of helper functions to determine the deltas of various Go "objects"

Usage

	import "github.com/jsimnz/go-delta"
    
    ..
    
	type someStruct struct {
    	Field1 string
        Field2 string
        Field3 int
    }
    
    ...
    
	val1 := someStruct{Field1: "Hello"}
    val2 := someStruct{Field1: "World"}
    
    diff, err := delta.Struct(val1, val2) // returns the delta (difference) between the 2 structs as a map
    
    // returns: 
    //	map[string]interface{}{
    //	   "Field1": "World",
    //    }
    // 
    // Which tells us that the second struct differs from the first by the field 'Field1',
    // and the new value is "World"

More delta functions to come...

Documentation

GoDoc: http://godoc.org/github.com/jsimnz/go-delta

Todo

  • More tests!

Author

John-Alan Simmons

About

A collection of helper functions to determine the deltas of various Go "objects"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages