forked from mirror/gorm
Update issues template
This commit is contained in:
parent
82d55b1054
commit
4a4b8234de
|
@ -1,4 +1,4 @@
|
|||
Your issue may already be reported! Please search on the [issue track](https://github.com/jinzhu/gorm/issues) before creating one.
|
||||
Your issue may already be reported! Please search on the [issue track](https://github.com/go-gorm/gorm/issues) before creating one.
|
||||
|
||||
### What version of Go are you using (`go version`)?
|
||||
|
||||
|
@ -8,34 +8,27 @@ Your issue may already be reported! Please search on the [issue track](https://g
|
|||
|
||||
### Please provide a complete runnable program to reproduce your issue. **IMPORTANT**
|
||||
|
||||
Need to runnable with [GORM's docker compose config](https://github.com/jinzhu/gorm/blob/master/docker-compose.yml) or please provides your config.
|
||||
Need to runnable with [GORM's docker compose config](https://github.com/go-gorm/gorm/blob/master/tests/docker-compose.yml) or please provides your config.
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "github.com/jinzhu/gorm/dialects/mssql"
|
||||
_ "github.com/jinzhu/gorm/dialects/mysql"
|
||||
_ "github.com/jinzhu/gorm/dialects/postgres"
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/driver/sqlite"
|
||||
// "gorm.io/driver/mysql"
|
||||
// "gorm.io/driver/postgres"
|
||||
// "gorm.io/driver/sqlserver"
|
||||
)
|
||||
|
||||
var db *gorm.DB
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
db, err = gorm.Open("sqlite3", "test.db")
|
||||
// db, err = gorm.Open("postgres", "user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable")
|
||||
// db, err = gorm.Open("mysql", "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True")
|
||||
// db, err = gorm.Open("mssql", "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
db.LogMode(true)
|
||||
}
|
||||
|
||||
func main() {
|
||||
db, err := gorm.Open(sqlite.Open(filepath.Join(os.TempDir(), "gorm.db")), &gorm.Config{})
|
||||
// db, err := gorm.Open(postgres.Open("user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"), &gorm.Config{})
|
||||
// db, err := gorm.Open(mysql.Open("gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"), &gorm.Config{})
|
||||
// db, err := gorm.Open(sqlserver.Open("sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"), &gorm.Config{})
|
||||
|
||||
/* your code */
|
||||
|
||||
if /* failure condition */ {
|
||||
fmt.Println("failed")
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue