ant0ine / go-json-rest-examples

Examples for go-json-rest
http://ant0ine.github.io/go-json-rest/
MIT License
195 stars 52 forks source link

Gorm example showing: cannot assign *gorm.DB to i.DB (type gorm.DB) in multiple assignment #19

Closed yeahia2508 closed 8 years ago

yeahia2508 commented 8 years ago

In Gorm example struct Impl is like this:

type Impl struct {
    DB gorm.DB
}

but bellow line causing this error: i.DB, err = gorm.Open("mysql", "root:@/gorm?charset=utf8&parseTime=True")

gorm.Open return *DB so Impl struct should be like this right? :

type Impl struct {
    DB *gorm.DB
}
ant0ine commented 8 years ago

Indeed, it looks like the Gorm API has changes. I'm fixing the example. Thanks for reporting!

ant0ine commented 8 years ago

done