func (d *Deck) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Deck)
	if d.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if d.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	if !d.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	d.Rev = existing.Rev
	if d.Modified.After(existing.Modified) {
		// The new version is newer than the existing one, so update
		return true, nil
	}
	// The new version is older, so we need to use the version we just read
	d.Modified = existing.Modified
	d.Imported = existing.Imported
	d.Name = existing.Name
	d.Description = existing.Description
	d.Cards = existing.Cards
	return false, nil
}
// MergeImport attempts to merge i into d, returning true on success, or false
// if no merge was necessary.
MergeImport attempts to merge i into d, returning true on success, or false
if no merge was necessary.
// MergeImport attempts to merge i into d returning true on success or false // if no merge was necessary .
func (d *Deck) MergeImport(i interface{}) (bool, error) {
	existing := i.(*Deck)
	if d.ID != existing.ID {
		return false, errors.New("IDs don't match")
	}
	if d.Imported.IsZero() || existing.Imported.IsZero() {
		return false, errors.New("not an import")
	}
	if !d.Created.Equal(existing.Created) {
		return false, errors.New("Created timestamps don't match")
	}
	d.Rev = existing.Rev
	if d.Modified.After(existing.Modified) {
		return true, nil
	}
	d.Modified = existing.Modified
	d.Imported = existing.Imported
	d.Name = existing.Name
	d.Description = existing.Description
	d.Cards = existing.Cards
	return false, nil
}
func ( d * Deck ) MergeImport ( i interface { } ) ( bool , error ) { existing := i . ( * Deck ) if d . ID != existing . ID { return false , errors . New ( " " ) } if d . Imported . IsZero ( ) || existing . Imported . IsZero ( ) { return false , errors . New ( " " ) } if ! d . Created . Equal ( existing . Created ) { return false , errors . New ( " " ) } d . Rev = existing . Rev if d . Modified . After ( existing . Modified ) { return true , nil } d . Modified = existing . Modified d . Imported = existing . Imported d . Name = existing . Name d . Description = existing . Description d . Cards = existing . Cards return false , nil }
MergeImport attempts to merge i into d, returning true on success, or false
if no merge was necessary.
MergeImport attempts to merge i into d returning true on success or false if no merge was necessary .
// The new version is newer than the existing one, so update // The new version is older, so we need to use the version we just read