Now I have upgraded my gorm package to the new version which is "gorm.io/gorm" but I am using package (github.com/qor/admin) that use the old version (github.com/jinzhu/gorm) of the package.
I need to pass gorm.DB(new version) value to a function of the package "github.com/qor/admin" that take gorm.DB(old version) as a parameter
package main
import (
adminPkg "github.com/qor/admin"
database "github.com/youssefsiam38/myfolder/db"
)
func main() {
db, err := database.Connection() // retrun db of type *gorm.io/gorm.DB
if err != nil {
panic(err)
}
admin := adminPkg.New(&adminPkg.AdminConfig{DB: db})
}
The err
vet: ./main.go:14:50: cannot use db (variable of type *gorm.DB) as *gorm.DB value in struct literal