At v1.25.1 version, The wrong dns will painc.
gorm.Open(
mysql.New(mysql.Config{
DSN: "test",
}),
)
--- FAIL: Test_Connect (0.20s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x12a1ad8]
goroutine 18 [running]:
testing.tRunner.func1.2({0x1462e20, 0x17f2120})
/usr/local/go/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1529 +0x39f
panic({0x1462e20, 0x17f2120})
/usr/local/go/src/runtime/panic.go:884 +0x213
database/sql.(*DB).Close(0x0)
/usr/local/go/src/database/sql/sql.go:877 +0x38
gorm.io/gorm.Open({0x157ddd0?, 0xc000106f98}, {0x0, 0x0, 0x0})
/Users/hible/go/pkg/mod/gorm.io/gorm@v1.25.1/gorm.go:185 +0x9df
192.168.0.11/go-extend/engine/gorm.Test_Connect(0xc00010b1e0)
/Volumes/git/engine/gorm/gorm_test.go:44 +0x3a5
testing.tRunner(0xc00010b1e0, 0x1504458)
/usr/local/go/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:1629 +0x3ea
FAIL 192.168.0.11/go-extend/engine/gorm 1.169s
FAIL
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: 514366607
See master has fixed it.