Since updating to the newest version of go and gorm, I gate strange errors on AutoMigrate. When I execute the following code:
package main
import (
"github.com/jinzhu/gorm"
_ "github.com/go-sql-driver/mysql"
)
type Lorem struct {
Id int
Name string
}
func main() {
db, _ := gorm.Open("mysql", "myproject:myproject@/myproject?charset=utf8&parseTime=True")
db.AutoMigrate(Lorem{})
}
I get the following error:
mygopath/myproject/main.go:16 using unaddressable value
Is there anything I do wrong here?
Thanks,
daseinhorn
db.AutoMigrate(&Lorem{})
I knew it was something that simple. Sorry. Just overlooked it completely!
Most helpful comment