Update issues template

This commit is contained in:
Jinzhu 2020-06-07 13:16:09 +08:00
parent 82d55b1054
commit 4a4b8234de
1 changed files with 14 additions and 21 deletions

View File

@ -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`)? ### 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** ### 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 ```go
package main package main
import ( import (
"github.com/jinzhu/gorm" "gorm.io/gorm"
_ "github.com/jinzhu/gorm/dialects/mssql" "gorm.io/driver/sqlite"
_ "github.com/jinzhu/gorm/dialects/mysql" // "gorm.io/driver/mysql"
_ "github.com/jinzhu/gorm/dialects/postgres" // "gorm.io/driver/postgres"
_ "github.com/jinzhu/gorm/dialects/sqlite" // "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() { 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 */ { if /* failure condition */ {
fmt.Println("failed") fmt.Println("failed")
} else { } else {