Gorm: module declares its path as: github.com/jinzhu/gorm but was required as: gorm.io/gorm

Created on 7 Jun 2020  路  4Comments  路  Source: go-gorm/gorm

Your issue may already be reported! Please search on the issue track before creating one.

What version of Go are you using (go version)?

go1.13

Which database and its version are you using?

Mysql 5.7

Please provide a complete runnable program to reproduce your issue. IMPORTANT

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)
    }
}

gorm_v1

Most helpful comment

I am working on that, please use go get gorm.io/[email protected] to install for now.

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Quentin-M picture Quentin-M  路  3Comments

bramp picture bramp  路  3Comments

hypertornado picture hypertornado  路  3Comments

superwf picture superwf  路  3Comments

youtwo123 picture youtwo123  路  3Comments