Your issue may already be reported! Please search on the issue track before creating one.
go version)?go1.13
Mysql 5.7
Need to runnable with GORM's docker compose config or please provides your config.
package main
import (
"fmt"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
var GDB *gorm.DB
func main() {
var err error
dsn := "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
GDB, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})
if err != nil {
fmt.Println("open db err", err)
}
}
Run go build,will get error:
go: finding gorm.io/driver/mysql latest
go: gotest imports
gorm.io/driver/mysql imports
gorm.io/gorm: gorm.io/[email protected]: parsing go.mod:
module declares its path as: github.com/jinzhu/gorm
but was required as: gorm.io/gorm
I am working on that, please use go get gorm.io/[email protected] to install for now.
This issue will be automatically closed because it is marked as GORM V1 issue, we have released the public testing GORM V2 release and its documents https://v2.gorm.io/docs/ already, the testing release has been used in some production services for a while, and going to release the final version in following weeks, we are still actively collecting feedback before it, please open a new issue for any suggestion or problem, thank you
Also check out https://github.com/go-gorm/gorm/wiki/GORM-V2-Release-Note-Draft for how to use the public testing version and its changelog
go get github.com/jinzhu/gorm@v2_dev
go get github.com/jinzhu/gorm@v2_dev
v2 will get error
go: github.com/jinzhu/gorm v2_dev => v1.9.13-0.20200602011801-e986371a42bb
go get: github.com/jinzhu/[email protected]: parsing go.mod:
module declares its path as: gorm.io/gorm
but was required as: github.com/jinzhu/gorm
Most helpful comment
I am working on that, please use
go get gorm.io/[email protected]to install for now.