Merge pull request #1192 from danhardman/patch-1

Update CONTRIBUTING.md executable script template
This commit is contained in:
Jinzhu 2016-09-25 14:24:25 +08:00 committed by GitHub
commit 129a142371
1 changed files with 14 additions and 14 deletions

View File

@ -27,19 +27,19 @@
package main package main
import ( import (
_ "github.com/mattn/go-sqlite3"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
) )
var db gorm.DB var db *gorm.DB
func init() { func init() {
var err error var err error
db, err = gorm.Open("sqlite3", "test.db") db, err = gorm.Open("sqlite3", "test.db")
// db, err := gorm.Open("postgres", "user=username dbname=password sslmode=disable") // db, err = gorm.Open("postgres", "user=username dbname=password sslmode=disable")
// db, err := gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True") // db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True")
if err != nil { if err != nil {
panic(err) panic(err)
} }