func ConflictResolve(existingVal Value, existingState State, newVal Value, newState State, sysState State) ConflictResolution {
	// Existing gunjs impl serializes to JSON first to do lexical comparisons, so we will too
	if sysState < newState {
		return ConflictResolutionTooFutureDeferred
	} else if newState < existingState {
		return ConflictResolutionOlderHistorical
	} else if existingState < newState {
		return ConflictResolutionNewerUpdate
	} else if existingVal == newVal {
		return ConflictResolutionSameKeep
	} else if existingJSON, err := json.Marshal(existingVal); err != nil {
		panic(err)
	} else if newJSON, err := json.Marshal(newVal); err != nil {
		panic(err)
	} else if bytes.Compare(existingJSON, newJSON) < 0 {
		return ConflictResolutionSameUpdate
	} else {
		return ConflictResolutionSameKeep
	}
}
// ConflictResolve checks the existing val/state, new val/state, and the current
// machine state to choose what to do with the update. Note, the existing val
// should always exist meaning it will never return
// ConflictResolutionNeverSeenUpdate.
ConflictResolve checks the existing val/state, new val/state, and the current
machine state to choose what to do with the update. Note, the existing val
should always exist meaning it will never return
ConflictResolutionNeverSeenUpdate.
// ConflictResolve checks the existing val / state new val / state and the current // machine state to choose what to do with the update . Note the existing val // should always exist meaning it will never return // ConflictResolutionNeverSeenUpdate .
func ConflictResolve(existingVal Value, existingState State, newVal Value, newState State, sysState State) ConflictResolution {
	if sysState < newState {
		return ConflictResolutionTooFutureDeferred
	} else if newState < existingState {
		return ConflictResolutionOlderHistorical
	} else if existingState < newState {
		return ConflictResolutionNewerUpdate
	} else if existingVal == newVal {
		return ConflictResolutionSameKeep
	} else if existingJSON, err := json.Marshal(existingVal); err != nil {
		panic(err)
	} else if newJSON, err := json.Marshal(newVal); err != nil {
		panic(err)
	} else if bytes.Compare(existingJSON, newJSON) < 0 {
		return ConflictResolutionSameUpdate
	} else {
		return ConflictResolutionSameKeep
	}
}
func ConflictResolve ( existingVal Value , existingState State , newVal Value , newState State , sysState State ) ConflictResolution { if sysState < newState { return ConflictResolutionTooFutureDeferred } else if newState < existingState { return ConflictResolutionOlderHistorical } else if existingState < newState { return ConflictResolutionNewerUpdate } else if existingVal == newVal { return ConflictResolutionSameKeep } else if existingJSON , err := json . Marshal ( existingVal ) ; err != nil { panic ( err ) } else if newJSON , err := json . Marshal ( newVal ) ; err != nil { panic ( err ) } else if bytes . Compare ( existingJSON , newJSON ) < 0 { return ConflictResolutionSameUpdate } else { return ConflictResolutionSameKeep } }
ConflictResolve checks the existing val/state, new val/state, and the current
machine state to choose what to do with the update.
ConflictResolve checks the existing val / state new val / state and the current machine state to choose what to do with the update .
// Existing gunjs impl serializes to JSON first to do lexical comparisons, so we will too