gocopper / copper

πŸš€β€β€β€Ž β€Žβ€β€β€Žβ€β€β€Žβ€Žβ€Žβ€Žβ€Žβ€ŽCopper is a Go toolkit complete with everything you need to build web apps.

Home Page:https://gocopper.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot use r.db (type *"gorm.io/gorm".DB) as type *"github.com/jinzhu/gorm".DB

mattn opened this issue Β· comments

commented

I'm trying to build tutorial app using copper but following error occured.

func (r *PostsRepo) GetPostByID(ctx context.Context, id string) (*Post, error) {
	db := csql.GetConn(ctx, r.db)
	fmt.Println(db)
	return nil, nil
}
.\main.go:30:27: cannot use r.db (type *"gorm.io/gorm".DB) as type *"github.com/jinzhu/gorm".DB in argument to csql.GetConn

Hi @mattn, can you make sure that you are using github.com/jinzhu/gorm in your import statements and try again?

I believe the gorm repository has moved to gorm.io/gorm but Copper has not been updated to use that yet.

commented

Ah, sorry. I did not read your mention.

I believe the gorm repository has moved to gorm.io/gorm but Copper has not been updated to use that yet.

Yes, I'm waiting the fix. Thank you. :)

This should now be fixed in ffe3eeb!

commented

Thank you!