Add db copy and clone

This commit is contained in:
Ettore Di Giacinto
2020-12-19 17:45:50 +01:00
parent e52bc4f2b2
commit 736c9470cf
7 changed files with 79 additions and 28 deletions

View File

@@ -270,6 +270,14 @@ func (db *InMemoryDatabase) getProvide(p Package) (Package, error) {
return db.FindPackage(pa)
}
func (db *InMemoryDatabase) Clone(to PackageDatabase) error {
return clone(db, to)
}
func (db *InMemoryDatabase) Copy() (PackageDatabase, error) {
return copy(db)
}
func (db *InMemoryDatabase) encodePackage(p Package) (string, string, error) {
pd, ok := p.(*DefaultPackage)
if !ok {