Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

jsimnz/go-delta

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
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

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.