func NewAdded(position Position, value interface{}) *Added {
	d := Added{postDelta: postDelta{position}, Value: value}
	return &d
}
NewAdded returns a new Added
package gojsondiff
import (
	"errors"
	dmp "github.com/sergi/go-diff/diffmatchpatch"
	"reflect"
	"strconv"
)
type Delta interface {
	Similarity() (similarity float64)
}
type similariter interface {
	similarity() (similarity float64)
}
type similarityCache struct {
	similariter
	value float64
}
func newSimilarityCache(sim similariter) similarityCache {
	cache := similarityCache{similariter: sim, value: -1}
	return cache
}
func (cache similarityCache) Similarity() (similarity float64) {
	if cache.value < 0 {
		cache.value = cache.similariter.similarity()
	}
	return cache.value
}
type Position interface {
	String() (name string)
	CompareTo(another Position) bool
}
type Name string
func (n Name) String() (name string) {
	return string(n)
}
func (n Name) CompareTo(another Position) bool {
	return n < another.(Name)
}
type Index int
func (i Index) String() (name string) {
	return strconv.Itoa(int(i))
}
func (i Index) CompareTo(another Position) bool {
	return i < another.(Index)
}
type PreDelta interface {
	PrePosition() Position
	PreApply(object interface{}) interface{}
}
type preDelta struct{ Position }
func (i preDelta) PrePosition() Position {
	return Position(i.Position)
}
type preDeltas []PreDelta
func (s preDeltas) Len() int {
	return len(s)
}
func (s preDeltas) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}
func (s preDeltas) Less(i, j int) bool {
	return !s[i].PrePosition().CompareTo(s[j].PrePosition())
}
type PostDelta interface {
	PostPosition() Position
	PostApply(object interface{}) interface{}
}
type postDelta struct{ Position }
func (i postDelta) PostPosition() Position {
	return Position(i.Position)
}
type postDeltas []PostDelta
func (s postDeltas) Len() int {
	return len(s)
}
func (s postDeltas) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}
func (s postDeltas) Less(i, j int) bool {
	return s[i].PostPosition().CompareTo(s[j].PostPosition())
}
type Object struct {
	postDelta
	similarityCache
	Deltas []Delta
}
func NewObject(position Position, deltas []Delta) *Object {
	d := Object{postDelta: postDelta{position}, Deltas: deltas}
	d.similarityCache = newSimilarityCache(&d)
	return &d
}
func (d *Object) PostApply(object interface{}) interface{} {
	switch object.(type) {
	case map[string]interface{}:
		o := object.(map[string]interface{})
		n := string(d.PostPosition().(Name))
		o[n] = applyDeltas(d.Deltas, o[n])
	case []interface{}:
		o := object.([]interface{})
		n := int(d.PostPosition().(Index))
		o[n] = applyDeltas(d.Deltas, o[n])
	}
	return object
}
func (d *Object) similarity() (similarity float64) {
	similarity = deltasSimilarity(d.Deltas)
	return
}
type Array struct {
	postDelta
	similarityCache
	Deltas []Delta
}
func NewArray(position Position, deltas []Delta) *Array {
	d := Array{postDelta: postDelta{position}, Deltas: deltas}
	d.similarityCache = newSimilarityCache(&d)
	return &d
}
func (d *Array) PostApply(object interface{}) interface{} {
	switch object.(type) {
	case map[string]interface{}:
		o := object.(map[string]interface{})
		n := string(d.PostPosition().(Name))
		o[n] = applyDeltas(d.Deltas, o[n])
	case []interface{}:
		o := object.([]interface{})
		n := int(d.PostPosition().(Index))
		o[n] = applyDeltas(d.Deltas, o[n])
	}
	return object
}
func (d *Array) similarity() (similarity float64) {
	similarity = deltasSimilarity(d.Deltas)
	return
}
type Added struct {
	postDelta
	similarityCache
	Value interface{}
}